exitStatus.sh lets the setup bash script know if the docker process exited cleanly

This commit is contained in:
jash
2018-11-14 23:05:29 +01:00
committed by kexkey
parent 4ba6d4b4a5
commit 7ecc6c3edc
2 changed files with 15 additions and 0 deletions

8
dist/setup.sh vendored
View File

@@ -167,6 +167,14 @@ configure() {
-e DEFAULT_USER=$USER \
--log-driver=none$pw_env \
--rm$interactive cyphernodeconf:latest $(id -u):$(id -g) yo --no-insight cyphernode$gen_options $recreate
if [[ -f exitStatus.sh ]]; then
. ./exitStatus.sh
rm ./exitStatus.sh
fi
if [[ ! $EXIT_STATUS == 0 ]]; then
exit 1
fi
}
copy_file() {

View File

@@ -104,6 +104,10 @@ module.exports = class extends Generator {
this.featureChoices = featureChoices;
if( fs.existsSync(path.join('/data', 'exitStatus.sh')) ) {
fs.unlinkSync(path.join('/data', 'exitStatus.sh'));
}
}
async _initConfig() {
@@ -311,6 +315,9 @@ module.exports = class extends Generator {
}
}
fs.writeFileSync(path.join('/data', 'exitStatus.sh'), 'EXIT_STATUS=0');
}
install() {