dotfiles/symlinks/bin/create-java-executable

24 lines
388 B
Plaintext
Raw Normal View History

2021-01-07 08:09:41 +00:00
#!/bin/sh
FILE=$1
OUTPUT=$2
filename=$(basename -- "$FILE")
extension="${filename##*.}"
filename="${filename%.*}"
if [ ! -f "$FILE" ]; then
echo "$FILE is not a file"
exit 1
fi
if [ "$extension" != "jar" ]; then
echo "$FILE is not a jar"
exit 1
fi
if [ -z "$OUTPUT" ]; then
OUTPUT=$filename
fi
2022-05-15 14:35:43 +00:00
cat ~/.local/opt/script_utils/java-stub.sh $FILE > $OUTPUT && chmod +x $OUTPUT