Skip to content

Commit

Permalink
fix homebrew publish and force early error
Browse files Browse the repository at this point in the history
  • Loading branch information
maxandersen committed Dec 28, 2019
1 parent 06ac733 commit 2411610
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
8 changes: 6 additions & 2 deletions misc/updatebrew.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
########################################################################
### Update homebrew

set -e

jbang_version=`ls build/distributions/jbang-*.*.zip | sed -e 's/.*jbang-\(.*\).zip/\1/g'`
echo "Updating jbang brew with version $jbang_version"
DIST=`ls build/distributions/jbang-${jbang_version}.zip | cut -f1 -d ' '`
sha256=`cat $DIST.sha256`

rm -rf homebrew-tap
git clone https://github.com/maxandersen/homebrew-tap.git

cp build/brew/formula/jbang.rb Formula/jbang.rb

cd homebrew-tap

git config user.name "Max Rydahl Andersen"
git config user.email "[email protected]"

cp ../build/brew/Formula/jbang.rb Formula/jbang.rb

git add Formula/jbang.rb
git commit -m "jbang v${jbang_version}"
Expand All @@ -24,5 +28,5 @@ echo $remote_repo
git push "${remote_repo}" --follow-tags


## to test use `brew install holgerbrandl/tap/kscript`
## to test use `brew install maxandersen/tap/jbang`

4 changes: 3 additions & 1 deletion misc/updatesdkman.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@

set -e

jbang_version=`ls build/distributions/jbang-*.*.zip | sed -e 's/.*jbang-\(.*\).zip/\1/g'`
echo "Updating jbang sdkman with version $jbang_version"


echo ${SDKMAN_CONSUMER_KEY} ${SDKMAN_CONSUMER_TOKEN} ${kscript_version}
echo ${SDKMAN_CONSUMER_KEY} ${SDKMAN_CONSUMER_TOKEN} ${jbang_version}
#echo ${SDKMAN_CONSUMER_KEY} | cut -c-5
#echo ${SDKMAN_CONSUMER_TOKEN} | cut -c-5

Expand Down
2 changes: 1 addition & 1 deletion src/main/scripts/jbang
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ if [[ -z "$JAVA_HOME" ]]; then JAVA_EXEC="java"; else JAVA_EXEC="$JAVA_HOME/bin/
## expose the name of the script being run to the script itself
export JBANG_FILE="$1"

## run it using command substitution to have just the user process once kscript is done
## run it using command substitution to have just the user process once jbang is done
eval "exec $(${JAVA_EXEC} -classpath ${jarPath} dk.xam.jbang.Main "$@")"
1 change: 0 additions & 1 deletion src/test/java/dk/xam/jbang/TestMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,4 @@ void testDependencies() throws FileNotFoundException {
assertThat(result, containsString("log4j"));
}


}
2 changes: 1 addition & 1 deletion src/test/java/dk/xam/jbang/TestScript.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class TestScript {
+ "\t\t\t+ \" jbang (-h | --help)\\n\" + \"\\n\" + \"Options:\\n\"\n"
+ "\t\t\t+ \" -t, --text Enable stdin support API for more streamlined text processing [default: latest]\\n\"\n"
+ "\t\t\t+ \" --package Package script and dependencies into self-dependent binary\\n\"\n"
+ "\t\t\t+ \" --idea boostrap IDEA from a kscript\\n\"\n"
+ "\t\t\t+ \" --idea boostrap IDEA from a jbang\\n\"\n"
+ "\t\t\t+ \" -i, --interactive Create interactive shell with dependencies as declared in script\\n\"\n"
+ "\t\t\t+ \" - Read script from the STDIN\\n\" + \" -h, --help Print this text\\n\"\n"
+ "\t\t\t+ \" --clear-cache Wipe cached script jars and urls\\n\" + \"\";\n" + "\n"
Expand Down

0 comments on commit 2411610

Please sign in to comment.