From 0437e4a456a219fdc50fc892f53cbf104c027e7d Mon Sep 17 00:00:00 2001 From: oitsjustjose Date: Sat, 28 Aug 2021 23:09:36 -0500 Subject: [PATCH] Initial commit --- scripts/shell/slabs.sh | 45 +++++++++++++++++++++++++++++++++++++ scripts/shell/woodcutter.sh | 45 +++++++++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100755 scripts/shell/slabs.sh create mode 100755 scripts/shell/woodcutter.sh diff --git a/scripts/shell/slabs.sh b/scripts/shell/slabs.sh new file mode 100755 index 0000000..0e26351 --- /dev/null +++ b/scripts/shell/slabs.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +### BOILERPLATE: DETECTING PYTHON ### + +PYTHON=$(which python) +if [ $? -eq 1 ] +then + PYTHON=$(which python3) + if [ $? -eq 1 ] + then + printf "\e[31mCould not determine Python[3] path - is it installed?\e[39m" + exit + fi +fi + +### BOILERPLATE: DETECTING PIP ### + +PIP=$(which pip) +if [ $? -eq 1 ] +then + PYTHON=$(which pip3) + if [ $? -eq 1 ] + then + printf "\e[31mCould not determine Pip[3] path - is it installed?\e[39m" + exit + fi +fi + +### BOILERPLATE: INSTALLING DEPS ### + +printf "\e[95mInstalling prerequisites... \e[39m" +cd "$(pwd)/../.." +$PIP install -q -r requirements.txt; +printf "\e[32mDone!\e[39m\n" + +### END BOILERPLATE! ### + +# Make user wait to validate that they have everything ready. +printf "\e[93mFor this script to work, an export of Blocks (data) from CraftDumper + (https://dv2ls.com/craftdumper) must be in the root of this directory.\e[39m\n" +read -rsn1 -p"If it is not, do so now before pressing any key...";echo + +printf "\n\n\n" + +$PYTHON -m src.modules.slab_to_block; \ No newline at end of file diff --git a/scripts/shell/woodcutter.sh b/scripts/shell/woodcutter.sh new file mode 100755 index 0000000..e90f5bc --- /dev/null +++ b/scripts/shell/woodcutter.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +### BOILERPLATE: DETECTING PYTHON ### + +PYTHON=$(which python) +if [ $? -eq 1 ] +then + PYTHON=$(which python3) + if [ $? -eq 1 ] + then + printf "\e[31mCould not determine Python[3] path - is it installed?\e[39m" + exit + fi +fi + +### BOILERPLATE: DETECTING PIP ### + +PIP=$(which pip) +if [ $? -eq 1 ] +then + PYTHON=$(which pip3) + if [ $? -eq 1 ] + then + printf "\e[31mCould not determine Pip[3] path - is it installed?\e[39m" + exit + fi +fi + +### BOILERPLATE: INSTALLING DEPS ### + +printf "\e[95mInstalling prerequisites... \e[39m" +cd "$(pwd)/../.." +$PIP install -q -r requirements.txt; +printf "\e[32mDone!\e[39m\n" + +### END BOILERPLATE! ### + +# Make user wait to validate that they have everything ready. +printf "\e[93mFor this script to work, an export of Blocks (data) from CraftDumper + (https://dv2ls.com/craftdumper) must be in the root of this directory.\e[39m\n" +read -rsn1 -p"If it is not, do so now before pressing any key...";echo + +printf "\n\n\n" + +$PYTHON -m src.modules.druidcraft_woodcutter; \ No newline at end of file