diff --git a/.gitignore b/.gitignore index bc0c19d..561dd00 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,8 @@ /args/config*.json /args/param.json /args/keys*.json +/args/prime_index*.b +/args/indexes*/ /log.txt /bash_start* *test* diff --git a/package.json b/package.json index 00adc71..a737f31 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "express-session": "^1.17.2", "mysql": "^2.18.1", "node-fetch": "^2.6.1", + "proper-lockfile": "^4.1.2", "ws": "^8.2.3" }, "devDependencies": {}, diff --git a/setup/configure-settings.js b/setup/configure-settings.js index e74baaf..3a9ac8b 100644 --- a/setup/configure-settings.js +++ b/setup/configure-settings.js @@ -122,6 +122,6 @@ function configure() { } if (!module.parent) - configure().then(_ => null).catch(error => console.error(error)); + configure().then(_ => null).catch(error => console.error(error)).finally(_ => process.exit(0)); else module.exports = configure; \ No newline at end of file diff --git a/setup/create-schema.js b/setup/create-schema.js index 1de1212..8f7f798 100644 --- a/setup/create-schema.js +++ b/setup/create-schema.js @@ -40,6 +40,6 @@ function createSchema() { } if (!module.parent) - createSchema().then(_ => null).catch(_ => null); + createSchema().then(_ => null).catch(_ => null).finally(_ => process.exit(0)); else module.exports = createSchema; \ No newline at end of file diff --git a/setup/help.js b/setup/help.js index c431269..910e53a 100644 --- a/setup/help.js +++ b/setup/help.js @@ -8,7 +8,6 @@ npm run setup - Finish the setup (configure and reset password npm run configure - Configure the app. npm run reset-password - Reset the password (for private-key). npm run create-schema - Create schema in MySQL database. -npm run configure-backup - Configure the backup. npm run create-backup-schema - Create backup-schema in MySQL database. npm run backup - Run the backup-node. diff --git a/setup/post-install.js b/setup/post-install.js index e56f37a..0e0479f 100644 --- a/setup/post-install.js +++ b/setup/post-install.js @@ -23,13 +23,16 @@ getInput.YesOrNo('Do you want to finish the setup now').then(value => { .catch(_ => console.log('Reset the password later using: ')) .finally(_ => { console.log('npm run reset-password'); + process.exit(0); }) - } else + } else { console.log('Reset the password later using:\n' + 'npm run reset-password'); + process.exit(0); + } }) }) } else { console.log('Finish the setup later using:\n' + 'npm run setup'); - console.log('To configure for backup use:\n' + 'npm run configure-backup'); + process.exit(0); } }) \ No newline at end of file diff --git a/setup/reset-password.js b/setup/reset-password.js index 04bd5c3..dfffd1d 100644 --- a/setup/reset-password.js +++ b/setup/reset-password.js @@ -89,6 +89,6 @@ function resetPassword() { } if (!module.parent) - resetPassword().then(_ => null).catch(error => console.error(error)); + resetPassword().then(_ => null).catch(_ => null).finally(_ => process.exit(0)); else module.exports = resetPassword; \ No newline at end of file