From 20bf723dffea5aba9eee5101a1bcd9b8c9b2b90b Mon Sep 17 00:00:00 2001 From: Matthew Sotoudeh Date: Tue, 18 Aug 2020 15:08:35 -0700 Subject: Complain when given a non-absolute path (#2) Closes Issue #1 by requesting the user explicitly provide an absolute path. --- setup_texlive.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/setup_texlive.sh b/setup_texlive.sh index 5a553b0..f88782a 100755 --- a/setup_texlive.sh +++ b/setup_texlive.sh @@ -9,6 +9,12 @@ fi texlive_mount=$1 install_dir=$2 +if [[ ! $install_dir =~ ^/ ]] +then + echo "Please use an absolute path for the install directory." + exit 1 +fi + read -p "Installing TeX Live. This will *OVERWRITE* $install_dir. Continue? [y/N] " -r if [[ $REPLY =~ ^[Yy]$ ]] then @@ -46,4 +52,5 @@ then echo "run --define TEXLIVE_FULL_DIR=$install_dir" >> ~/.bazelrc else echo "Aborting." + exit 1 fi -- cgit v1.2.3