-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
37 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
node_modules/ | ||
/coverage/ | ||
/npm-debug.log | ||
/docs-out/ | ||
/jsdoc-out/ | ||
/web/ |
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 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,33 @@ | ||
#!/usr/bin/env node | ||
|
||
'use strict' | ||
|
||
const path = require('path') | ||
const exec = require('child_process').execSync | ||
|
||
let cwd = path.resolve(__dirname, '..') | ||
|
||
// Get current web branch | ||
console.log('\n# Cloning web branch') | ||
exec('rm -rf web', { cwd }) | ||
exec('git clone git@github.com:interledger/five-bells-shared.git --branch gh-pages --single-branch web', { cwd }) | ||
|
||
// Update jsdoc | ||
console.log('\n# Updating API docs') | ||
exec('npm run jsdoc', { cwd }) | ||
exec('mkdir -p web/jsdoc', { cwd }) | ||
exec('cp -r jsdoc-out/* web/jsdoc/', { cwd }) | ||
|
||
// Push changes | ||
cwd = path.resolve(cwd, 'web') | ||
console.log('\n# Pushing web branch') | ||
exec('git add --all', { cwd }) | ||
|
||
const status = exec('git status --porcelain', { cwd }).toString('utf8') | ||
if (!status.length) { | ||
console.log('no changes') | ||
} else { | ||
console.log(status) | ||
exec('git commit -m \'chore: update gh-pages\'', { cwd }) | ||
exec('git push', { cwd }) | ||
} |