From e3d826cdb32cb28ee8219c116ba64b7a2282e081 Mon Sep 17 00:00:00 2001 From: Jay Lee Date: Tue, 1 Nov 2016 11:53:30 -0400 Subject: [PATCH] catch tar errors and exit. --- src/gam-install.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gam-install.sh b/src/gam-install.sh index 7fb93925..07b7ad2a 100755 --- a/src/gam-install.sh +++ b/src/gam-install.sh @@ -129,6 +129,13 @@ echo "Downloading file $name from $browser_download_url to $temp_archive_dir" mkdir -p $target_dir tar xf $temp_archive_dir/$name -C $target_dir +rc=$? +if (( $rc != 0 )); then + echo "ERROR: extracting the GAM archive with tar failed with error $rc. Exiting." + exit +else + echo "Finished extracting GAM archive." +fi # Update profile to add gam command alias_line="alias gam=$target_dir/gam/gam"