This repository has been archived by the owner on Nov 20, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 89
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
binsee
committed
Apr 11, 2018
1 parent
2780687
commit 95912da
Showing
2 changed files
with
44 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
'use strict' | ||
|
||
const fs = require('fs') | ||
|
||
const tpl = `# Padchat Sdk $ver$ Documentation | ||
` | ||
|
||
console.log(`args: ${process.argv}`) | ||
|
||
try { | ||
const tmpBuf = fs.readFileSync('./package.json') | ||
const data = JSON.parse(String(tmpBuf)) | ||
const ver = String(data.version || '') | ||
const str = tpl.replace('$ver$', `v${ver}` || 'Unknown version') | ||
|
||
fs.writeFileSync('docs/index.md', str) | ||
} catch (e) { | ||
console.error(e) | ||
process.exit(-1) | ||
} | ||
|