Skip to content

Commit

Permalink
scripts: bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ntzyz committed Oct 17, 2018
1 parent 8563d15 commit 280918c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
13 changes: 9 additions & 4 deletions scripts/upgrade.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ const path = require('path');
function getCurrentCommitHash () {
return new Promise((resolve) => {
child_process.exec('git rev-parse HEAD', (err, stdout) => {
resolve(stdout);
resolve(stdout.trim());
});
});
}

function evalGitPull () {
return new Promise((resolve) => {
child_process.exec('git pull', (err, stdout) => {
resolve(stdout);
resolve(stdout.trim());
});
});
}
Expand All @@ -28,7 +28,10 @@ function getCommitSinceHash (hash) {

function evalBuildBundle () {
return new Promise((resolve) => {
child_process.exec('npm run build', (err, stdout) => {
const cp = child_process.spawn('npm', ['run', 'build'], {
stdio: 'inherit',
});
cp.on('close', (code) => {
resolve();
});
});
Expand All @@ -46,6 +49,8 @@ async function main () {
...await getCommitSinceHash(currentCommitHash),
];

console.log(hashs);

console.log('Checking scripts to run...');
for (const hash of hashs) {
if (fs.existsSync(path.join(__dirname, `./${hash}.js`))) {
Expand All @@ -66,4 +71,4 @@ async function main () {
process.exit(0);
}

main();
main();
2 changes: 1 addition & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
.map(key => `<meta property="og:${key}" content="${og[key]}">`)
.join('\n ')
}}}
<script src="https://cdn.jsdelivr.net/npm/highlight.js@9.13.1/lib/index.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/highlight.js@9.13.1/styles/xcode.css">
<script src="https://cdn.jsdelivr.net/npm/babel-polyfill@7.0.0-beta.3/lib/index.min.js"></script>
<link href='https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600' rel='stylesheet' type='text/css'>
</head>
Expand Down

0 comments on commit 280918c

Please sign in to comment.