From 9e57a571398bfde4f2d9d41696e92db2b63015e5 Mon Sep 17 00:00:00 2001 From: maksimchepelev Date: Tue, 4 Dec 2018 17:30:50 +0300 Subject: [PATCH] feat(npm-scripts): init db automatically after installation Closes EWC-368 --- scripts/postinstall.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/scripts/postinstall.js b/scripts/postinstall.js index 8a74c5f02..a5bf6e22e 100644 --- a/scripts/postinstall.js +++ b/scripts/postinstall.js @@ -73,4 +73,15 @@ try { fs.unlinkSync(installationVariablesFile); } catch (e) { console.log('no previous version') -} \ No newline at end of file +} + +//init db +const options = { + env: { + 'NODE_ENV': 'production', + "PATH": process.env.PATH + }, + stdio: [process.stdin, process.stdout, process.stderr] +}; + +execSync('node ./src/main.js init', options); \ No newline at end of file