diff --git a/bin/crunchy.sh b/bin/crunchy.sh new file mode 100755 index 0000000..b1adc25 --- /dev/null +++ b/bin/crunchy.sh @@ -0,0 +1,10 @@ +#!/bin/bash +PARAMS=$* +for i in {1..20}; do + crunchy -u ${PARAMS} + if [ $? == 0 ]; then + break + fi + echo "Going to retry..." + sleep 3 +done \ No newline at end of file diff --git a/package.json b/package.json index c43f75f..9f543d2 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,8 @@ }, "version": "1.2.0", "bin": { - "crunchy": "./bin/crunchy" + "crunchy": "./bin/crunchy", + "crunchy.sh": "./bin/crunchy.sh" }, "dependencies": { "big-integer": "^1.6.27", diff --git a/src/cli.ts b/src/cli.ts index 6cabe0e..1d76c95 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -6,5 +6,8 @@ batch(process.argv, (err: any) => if (err) { console.error(err.stack || err); + process.exit(-1) } + console.info("Done!") + process.exit(0) });