-
Notifications
You must be signed in to change notification settings - Fork 21
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
3 changed files
with
48 additions
and
6 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,5 +1,6 @@ | ||
node_modules/ | ||
apidoc-out/ | ||
/node_modules/ | ||
/web/ | ||
/apidoc-out/ | ||
coverage/ | ||
*.cluster | ||
/npm-debug.log | ||
|
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,36 @@ | ||
#!/usr/bin/env node | ||
|
||
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-ledger.git --branch gh-pages --single-branch web', { cwd }) | ||
|
||
// Update apidoc | ||
console.log('\n# Updating API docs') | ||
exec('npm run apidoc', { cwd }) | ||
exec('mkdir -p web/apidoc', { cwd }) | ||
exec('cp -r apidoc-out/* web/apidoc/', { cwd }) | ||
|
||
// Update apidoc-template | ||
console.log('\n# Updating API doc template') | ||
exec('wget https://github.com/interledger/apidoc-template/archive/master.tar.gz -O - | tar xzf - --strip 1 -C web/apidoc', { cwd }) | ||
|
||
// Push changes | ||
console.log('\n# Pushing web branch') | ||
cwd = path.resolve(cwd, 'web') | ||
exec('cd web') | ||
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 }) | ||
} |