File tree Expand file tree Collapse file tree 1 file changed +23
-14
lines changed
Expand file tree Collapse file tree 1 file changed +23
-14
lines changed Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22
3+ set -Eeuo pipefail
4+
35MODULES=java.base,java.logging
46OUTPUT=jpicoc
5- VERSION=0.2
7+ VERSION=0.3
68JARNAME=PiccodeScript-$VERSION -jar-with-dependencies.jar
79JARDIR=target/
810
@@ -47,7 +49,7 @@ checkJarAndBuild() {
4749 log " Building from scratch."
4850 mvn package
4951 log " Verifying the compiler."
50- ./verify.sh
52+ ./verify.sh
5153 fi
5254}
5355
@@ -87,32 +89,39 @@ install() {
8789}
8890
8991verify () {
90- ./verify.sh
92+ ./verify.sh
9193}
9294
9395finalCleanUp () {
94- log " Final clean up"
95- rm -rf $OUTPUT $APP_NAME $JARDIR
96- log " Final clean up completed"
96+ log " Final clean up"
97+ rm -rf $OUTPUT $APP_NAME $JARDIR
98+ log " Final clean up completed"
9799}
98100
99101finalMessage () {
100- log " "
101- log " Please make sure to add $INSTALL /bin to your PATH"
102- log " Try running picoc --version to test the installation"
103- log " Run picoc --h for help and picoc run --repl for a quick repl session"
104- log " "
105- log " Thank you for installing PiccodeScript."
102+ log " "
103+ log " Please make sure to add $INSTALL /bin to your PATH"
104+ log " Try running picoc --version to test the installation"
105+ log " Run picoc --h for help and picoc run --repl for a quick repl session"
106+ log " "
107+ log " Thank you for installing PiccodeScript."
108+ }
109+
110+ handle_error () {
111+ log " Something went wrong"
112+ finalCleanUp
106113}
107114
115+ trap handle_error ERR
116+
108117main () {
109118 splash
110119 checkJarAndBuild
111120 checkAndClean
112121 buildImage
113122 install
114- finalCleanUp
115- finalMessage
123+ finalCleanUp
124+ finalMessage
116125}
117126
118127main
You can’t perform that action at this time.
0 commit comments