-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathshare.js
36 lines (31 loc) · 1006 Bytes
/
share.js
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
var ghpages = require("gh-pages")
var path = require("path")
var yargs = require("yargs")
var fs = require("fs")
var rimraf = require("rimraf")
var ncp = require("ncp").ncp
ncp.limit = 16
var NAME = yargs.argv._[0]
// Start off clearing the shares directory
rimraf("./shares", function() {
// Make the "shares/name" directory
fs.mkdirSync("shares/")
fs.mkdirSync("shares/" + NAME)
// Copy the build to the "shares/name" directory
ncp("builds/web/", "shares/" + NAME + "/", function(err) {
if (err) {
// Log any errors in copying
console.log("couldn't copy files: " + err)
}
else {
// Publish the build to the gh-pages branch
ghpages.publish(path.join(__dirname, 'shares/'), {
add: true,
repo: '[email protected]:mocsarcade/enchiridion.git',
logger: function(message) {
console.log(message);
}
})
}
})
})