Simplify main.js

Signed-off-by: Reinhard Naegele <unguiculus@gmail.com>
This commit is contained in:
Reinhard Naegele
2019-12-02 21:22:30 +01:00
parent e80da0f1b3
commit 46d7da99bf
+3 -14
View File
@@ -12,19 +12,8 @@
// # See the License for the specific language governing permissions and // # See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
const spawn = require('child_process').spawn const spawnSync = require('child_process').spawnSync;
const path = require("path"); const path = require("path");
const main = async () => { const proc = spawnSync('bash', [path.join(__dirname, 'main.sh')], {stdio: 'inherit'});
await new Promise((resolve, reject) => { process.exit(proc.status)
const proc = spawn('bash', [path.join(__dirname, 'main.sh')], {stdio: 'inherit'})
proc.on('close', resolve)
proc.on('error', reject)
})
}
main().catch(err => {
console.error(err)
console.error(err.stack)
process.exit(-1)
})