forked from CIS700-Procedural-Graphics/Project7-BioCrowds
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.js
More file actions
22 lines (20 loc) · 668 Bytes
/
Copy pathdeploy.js
File metadata and controls
22 lines (20 loc) · 668 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
var colors = require('colors');
var path = require('path');
var git = require('simple-git')(__dirname);
git.status(function(err, status) {
if (err) throw err;
if (!status.isClean()) {
console.error('Error: You have uncommitted changes! Please commit them first'.red);
} else {
git.raw(['subtree', 'split', '--prefix', 'build', '-b', 'gh-pages'], function(err, result) {
if (err) console.warn(err.toString().yellow);
git.push(['origin', 'gh-pages', '-f'], function(err, result) {
if (err) {
console.error(err.toString().red);
} else {
console.log('Deployed!'.green);
}
});
})
}
})