|
1 | | -const { cd, exec, echo, touch } = require("shelljs") |
2 | | -const { readFileSync } = require("fs") |
3 | | -const url = require("url") |
| 1 | +const { cd, exec, echo, touch } = require('shelljs'); |
| 2 | +const { readFileSync } = require('fs'); |
| 3 | +const url = require('url'); |
4 | 4 |
|
5 | | -let repoUrl |
6 | | -let pkg = JSON.parse(readFileSync("package.json") as any) |
7 | | -if (typeof pkg.repository === "object") { |
8 | | - if (!pkg.repository.hasOwnProperty("url")) { |
9 | | - throw new Error("URL does not exist in repository section") |
| 5 | +let repoUrl; |
| 6 | +let pkg = JSON.parse(readFileSync('package.json') as any); |
| 7 | +if (typeof pkg.repository === 'object') { |
| 8 | + if (!pkg.repository.hasOwnProperty('url')) { |
| 9 | + throw new Error('URL does not exist in repository section'); |
10 | 10 | } |
11 | | - repoUrl = pkg.repository.url |
| 11 | + repoUrl = pkg.repository.url; |
12 | 12 | } else { |
13 | | - repoUrl = pkg.repository |
| 13 | + repoUrl = pkg.repository; |
14 | 14 | } |
15 | 15 |
|
16 | | -let parsedUrl = url.parse(repoUrl) |
17 | | -let repository = (parsedUrl.host || "") + (parsedUrl.path || "") |
18 | | -let ghToken = process.env.GH_TOKEN |
| 16 | +let parsedUrl = url.parse(repoUrl); |
| 17 | +let repository = (parsedUrl.host || '') + (parsedUrl.path || ''); |
| 18 | +let ghToken = process.env.GH_TOKEN; |
19 | 19 |
|
20 | | -echo("Deploying docs!!!") |
21 | | -cd("docs") |
22 | | -touch(".nojekyll") |
23 | | -exec("git init") |
24 | | -exec("git add .") |
25 | | -exec('git config user.name "David Chanin"') |
26 | | -exec('git config user.email "[email protected]"') |
27 | | -exec('git commit -m "docs(docs): update gh-pages"') |
28 | | -exec( |
29 | | - `git push --force --quiet "https://${ghToken}@${repository}" master:gh-pages` |
30 | | -) |
31 | | -echo("Docs deployed!!") |
| 20 | +echo('Deploying docs!!!'); |
| 21 | +cd('docs'); |
| 22 | +touch('.nojekyll'); |
| 23 | +exec('git init'); |
| 24 | +exec('git add .'); |
| 25 | +exec('git config user.name "David Chanin"'); |
| 26 | +exec('git config user.email "[email protected]"'); |
| 27 | +exec('git commit -m "[ci skip] docs(docs): update gh-pages"'); |
| 28 | +exec(`git push --force --quiet "https://${ghToken}@${repository}" master:gh-pages`); |
| 29 | +echo('Docs deployed!!'); |
0 commit comments