Commit b0353721 authored by Joan Vallvé Navarro's avatar Joan Vallvé Navarro
Browse files

checking for valid paths

parent 42e2dc12
Pipeline #8655 failed with stages
in 100 minutes and 52 seconds
......@@ -35,6 +35,11 @@ func_check_yn () {
fi
}
# START #####################################################
CORES=$(nproc)
func_echo "The number of available cores on this machine is $CORES"
RUN_PATH=$PWD
## OPTIONS #####################################################
VERBOSE="true"
INSTALL_PLUGINS=""
......@@ -103,9 +108,21 @@ while getopts "vap:d:w:hf:c:" opt; do
;;
d) # deps path
DEPS_PATH=$OPTARG
if cd $DEPS_PATH ; then
func_echo "Valid dependency path."
else
echo "Invalid dependency path."
exit 1
fi
;;
w) # wolf path
WOLF_PATH=$OPTARG
if cd $WOLF_PATH ; then
func_echo "Valid wolf folder path."
else
echo "Invalid wolf folder path."
exit 1
fi
;;
h )
usage
......@@ -123,10 +140,6 @@ while getopts "vap:d:w:hf:c:" opt; do
esac
done
# START #####################################################
CORES=$(nproc)
func_echo "The number of available cores on this machine is $CORES"
RUN_PATH=$PWD
# UBUNTU
if [ "$UID" -eq 0 -o "$EUID" -eq 0 ]; then
......@@ -148,12 +161,16 @@ fi
# WOLF DEPENDENCIES #####################################################
cd $RUN_PATH
func_echo "You are in folder $PWD"
if [ $DEPS_PATH == "undefined" ]; then
echo "Enter path for dependencies (either /global/path or relative/path):"
read DEPS_PATH
fi
cd $DEPS_PATH
while ! cd $DEPS_PATH ; do
echo "Invalid dependency path. Enter path for dependencies (either /global/path or relative/path):"
read DEPS_PATH
done
DEPS_PATH=$PWD
func_echo "path dependencies: $DEPS_PATH"
......@@ -227,7 +244,10 @@ if [ $WOLF_PATH == "undefined" ]; then
echo "Enter path for wolf folder (either /global/path or relative/path):"
read WOLF_PATH
fi
cd $WOLF_PATH
while ! cd $WOLF_PATH ; do
echo "Invalid dependency path. Enter path for dependencies (either /global/path or relative/path):"
read WOLF_PATH
done
mkdir wolf
cd wolf
WOLF_PATH=$PWD
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment