Skip to content

Commit

Permalink
fixes for window build
Browse files Browse the repository at this point in the history
  • Loading branch information
joewalker committed Mar 21, 2012
1 parent feb3be0 commit 609a6e4
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions build.js
@@ -0,0 +1,47 @@

var copy = require('dryice').copy;
var fs = require('fs');
var os = require('os');
var spawn = require('child_process').spawn;

var release = __dirname + '/release';
copy.mkdirSync(release + '/content', 0755);
copy({
source: {
root: __dirname + '/content',
include: [ /.*\.js$/, /.*\.html$/ ]
},
dest: release + '/content'
});

copy.mkdirSync(release + '/skin', 0755);
copy({
source: {
root: __dirname + '/skin',
include: [ /.*\.css$/, /.*\.gif$/, /.*\.png$/ ]
},
dest: release + '/skin'
});

copy({
source: [ 'bootstrap.js', 'license.txt', 'README.md' ],
dest: release
});

var packageFile = fs.readFileSync(__dirname + '/package.json', 'utf8');
var version = JSON.parse(packageFile).version;
copy({
source: [ 'install.rdf' ],
filter: function(data) {
return data.toString().replace(/@VERSION@/, version);
},
dest: release
});

if (os.platform() === 'win32') {
var params = 'a ccdump.xpi skin content bootstrap.js license.txt README.md install.rdf';
spawn('7z.exe', [ params.split(' ') ], { cwd: release });
}
else {
spawn('zip', [ '-r', __dirname + '/ccdump.xpi', release ]);
}

0 comments on commit 609a6e4

Please sign in to comment.