-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy
executable file
·42 lines (36 loc) · 918 Bytes
/
deploy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env node
/**
* TODO:
* 1. Copy production required files only.
*
* 2. Make sure that changed files are replaced in the copy.
*
* 3. Have the main html file generated from a template so
* it can use a dynamic js version number to prevent bad
* cahceing.
*
*/
/**
* Dependencies
*/
var exec = require('child_process').exec;
/**
* Locals
*/
var outputDir = '~/Sites/square2';
// Compile the js.
exec('browserify main.js -o square.js', function cb(error, stdout, stderr) {
console.log('stdout: ' + stdout);
console.log('stderr: ' + stderr);
if (error !== null) {
console.log('exec error: ' + error);
}
});
// Copy the entire contents of the dev directory to the output directory.
exec('cp -R ./ ' + outputDir, function cb(error, stdout, stderr) {
console.log('stdout: ' + stdout);
console.log('stderr: ' + stderr);
if (error !== null) {
console.log('exec error: ' + error);
}
});