A few minor cleanups.
This commit is contained in:
parent
b0918ae039
commit
bae7c0628a
@ -1,5 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
ZENITY="zenity --width 800 --title mcresconvert"
|
||||||
|
|
||||||
for required in unzip convert composite zenity; do
|
for required in unzip convert composite zenity; do
|
||||||
type $required > /dev/null
|
type $required > /dev/null
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
@ -26,7 +28,7 @@ convert_file() {
|
|||||||
echo " - File: `basename "$@"`"
|
echo " - File: `basename "$@"`"
|
||||||
(
|
(
|
||||||
if ! mkdir "$n" > /dev/null 2>&1 ; then
|
if ! mkdir "$n" > /dev/null 2>&1 ; then
|
||||||
if ! zenity --question --width 800 --text="A texture pack folder with name \"$n\" already exists, overwrite?" --default-cancel ; then
|
if ! $ZENITY --question --text="A texture pack folder with name \"$n\" already exists, overwrite?" --default-cancel ; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
rm -rf "$n"
|
rm -rf "$n"
|
||||||
@ -248,8 +250,8 @@ RENAMES
|
|||||||
echo -e "." >> _n/_counter
|
echo -e "." >> _n/_counter
|
||||||
cp "_z/$IN" "$OUT"
|
cp "_z/$IN" "$OUT"
|
||||||
# uncomment below 2 lines to see if any textures were not found.
|
# uncomment below 2 lines to see if any textures were not found.
|
||||||
else
|
#else
|
||||||
echo "+$IN $OUT $FLAG: Not Found"
|
# echo "+$IN $OUT $FLAG: Not Found"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
@ -565,9 +567,9 @@ if [ -n "$1" ]; then
|
|||||||
exit $?
|
exit $?
|
||||||
fi
|
fi
|
||||||
|
|
||||||
choice=`zenity --list --title "Choose resource packs to convert" --column="Convert" \
|
choice=`$ZENITY --list --title "Choose resource packs to convert" --column="Convert" \
|
||||||
--text "Do you want to convert installed resource packs, or convert a single zip file?" \
|
--text "Do you want to convert installed resource packs, or convert a single zip file?" \
|
||||||
--column="Description" --height 400 --width 800 \
|
--column="Description" --height 400 \
|
||||||
"all" "Find Minecraft resource packs installed in your minecraft folders and convert those automatically" \
|
"all" "Find Minecraft resource packs installed in your minecraft folders and convert those automatically" \
|
||||||
"default" "Convert the default resource pack" \
|
"default" "Convert the default resource pack" \
|
||||||
"other" "Choose a file to convert manually"`
|
"other" "Choose a file to convert manually"`
|
||||||
@ -584,7 +586,7 @@ if [ "$choice" == "all" ]; then
|
|||||||
done
|
done
|
||||||
elif [ "$choice" == "other" ]; then
|
elif [ "$choice" == "other" ]; then
|
||||||
# assume file name to zip is passed
|
# assume file name to zip is passed
|
||||||
convert_file "`zenity --file-selection --file-filter="*.zip"`"
|
convert_file "`$ZENITY --file-selection --file-filter="*.zip"`"
|
||||||
elif [ "$choice" == "default" ]; then
|
elif [ "$choice" == "default" ]; then
|
||||||
if ! cp ~/.minecraft/versions/1.9/1.9.jar /tmp/mc-default-1.9.zip ; then
|
if ! cp ~/.minecraft/versions/1.9/1.9.jar /tmp/mc-default-1.9.zip ; then
|
||||||
exit 1
|
exit 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user