-
Notifications
You must be signed in to change notification settings - Fork 378
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Finish the Node script for publishing the site
Related to #196
- Loading branch information
1 parent
f9b7f73
commit e57353d
Showing
6 changed files
with
78 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
var shell = require('shelljs'); | ||
|
||
if (!shell.which('git')) { | ||
shell.echo('Sorry, this script requires git'); | ||
shell.exit(1); | ||
} | ||
|
||
console.info('Running git checkout -b gh-pages'); | ||
checkResultCode(shell.exec('git checkout -b gh-pages')); | ||
|
||
console.info('Running rm -rf node_modules'); | ||
checkResultCode(shell.rm('-rf', 'node_modules')); | ||
|
||
console.info('Running rm -rf site/node_modules'); | ||
checkResultCode(shell.rm('-rf', 'site/node_modules')); | ||
|
||
console.info('Running rm -rf docs'); | ||
checkResultCode(shell.rm('-rf', 'docs')); | ||
|
||
console.info('Running rm -rf guides'); | ||
checkResultCode(shell.rm('-rf', 'guides')); | ||
|
||
console.info('Running $(MAKE) -C site build'); | ||
checkResultCode(shell.exec('cd site && npm install --no-shrinkwrap && npm run build && cd ..')); | ||
|
||
console.info('Running npm install --no-shrinkwrap'); | ||
checkResultCode(shell.exec('npm install --no-shrinkwrap')); | ||
|
||
console.info('Running npm run document:force'); | ||
checkResultCode(shell.exec('npm run document:force')); | ||
|
||
console.info('Running git add -f docs/'); | ||
checkResultCode(shell.exec('git add -f docs/')); | ||
|
||
console.info('Running git add -f guides/'); | ||
checkResultCode(shell.exec('git add -f guides/')); | ||
|
||
console.info('Running git add -f site/static/'); | ||
checkResultCode(shell.exec('git add -f site/static/')); | ||
|
||
console.info('Running git add -f examples/'); | ||
checkResultCode(shell.exec('git add -f examples/')); | ||
|
||
console.info('Running git add -f index.html'); | ||
checkResultCode(shell.exec('git add -f index.html')); | ||
|
||
console.info('Running git add -f CNAME'); | ||
checkResultCode(shell.exec('git add -f CNAME')); | ||
|
||
console.info('Running git commit -m "Publish docs"'); | ||
checkResultCode(shell.exec('git commit -m "Publish docs"')); | ||
|
||
console.info('Running git push -f origin gh-pages'); | ||
checkResultCode(shell.exec('git push -f origin gh-pages')); | ||
|
||
console.info('Running git checkout -'); | ||
checkResultCode(shell.exec('git checkout -')); | ||
|
||
console.info('Running git branch -D gh-pages'); | ||
checkResultCode(shell.exec('git branch -D gh-pages')); | ||
|
||
function checkResultCode(result) { | ||
if (result.code !== 0) { | ||
shell.exit(result.code); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.