Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/dev/jbang/cli/Build.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ public Integer doCall() throws IOException {
build(script);
}

return EXIT_EXECUTE;
return EXIT_OK;
}
}
42 changes: 21 additions & 21 deletions src/main/scripts/jbang
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,27 @@ download() {

abs_jbang_path=$(resolve_symlink $(absolute_path $0))

case "$(uname -s)" in
Linux*)
os=linux;;
Darwin*)
os=mac;;
CYGWIN*|MINGW*)
os=windows;;
*) echo "Unsupported Operating System: $(uname -s)" 1>&2; exit 1;;
esac

case "$(uname -m)" in
i?86)
arch=x32;;
x86_64|amd64)
arch=x64;;
aarch64)
arch=aarch64;;
*)
echo "Unsupported Architecture: $(uname -m)" 1>&2; exit 1;;
esac

## when mingw/git bash or cygwin fall out to just running the bat file.
if [[ $os == windows ]]; then
$(dirname $abs_jbang_path)/jbang.cmd $*
Expand Down Expand Up @@ -72,27 +93,6 @@ else
eval "exec $JBDIR/bin/jbang $*"
fi

case "$(uname -s)" in
Linux*)
os=linux;;
Darwin*)
os=mac;;
CYGWIN*|MINGW*)
os=windows;;
*) echo "Unsupported Operating System: $(uname -s)" 1>&2; exit 1;;
esac

case "$(uname -m)" in
i?86)
arch=x32;;
x86_64|amd64)
arch=x64;;
aarch64)
arch=aarch64;;
*)
echo "Unsupported Architecture: $(uname -m)" 1>&2; exit 1;;
esac

# Find/get a JDK
unset JAVA_EXEC
if [[ -n "$JAVA_HOME" ]]; then
Expand Down
3 changes: 2 additions & 1 deletion src/main/scripts/jbang.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ if "!JAVA_EXEC!"=="" (
)
)

set tmpfile=%TDIR%\%RANDOM%.tmp
if not exist "%TDIR%" ( mkdir "%TDIR%" )
set tmpfile=%TDIR%\%RANDOM%.jbang.tmp
rem execute jbang and pipe to temporary random file
set "CMD=!JAVA_EXEC!"
SETLOCAL DISABLEDELAYEDEXPANSION
Expand Down