a helper function for Node exec shell script file
/*
const { stdout, stderr } = execShell('scripts/hexo.sh');
if (stderr) {
res.send('error');
}
...
*/
async function execShell(scriptPath) {
const execFile = require('util').promisify(require('child_process').execFile);
return await execFile('sh', [scriptPath]);
}