[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 5cf6a48 1/4: Prefer simpler shell code
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 5cf6a48 1/4: Prefer simpler shell code |
Date: |
Mon, 13 Nov 2017 14:11:27 -0500 (EST) |
branch: master
commit 5cf6a4836d69917220e8b78e7fe80693b829cdf6
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Prefer simpler shell code
*check_git_setup.sh: Simplify.
*install_msw.sh: Recommend future simplification.
See:
https://lists.nongnu.org/archive/html/lmi/2017-11/msg00022.html
---
check_git_setup.sh | 10 +++++++---
install_msw.sh | 3 +++
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/check_git_setup.sh b/check_git_setup.sh
index 66b18cf..a00cc89 100755
--- a/check_git_setup.sh
+++ b/check_git_setup.sh
@@ -24,11 +24,15 @@
# For msw (cygwin) only, make sure 'core.filemode' is "false". See:
# https://lists.nongnu.org/archive/html/lmi/2017-11/msg00018.html
-if [ "$(expr substr $(uname -s) 1 6)" = "CYGWIN" ]
-then
+case $(uname -s) in
+ (CYGWIN*)
printf "cygwin detected\n"
git config --global core.filemode false
-fi
+ ;;
+ (*)
+ printf "cygwin not detected--assuming OS is POSIX\n"
+ ;;
+esac
printf "core.filemode is '%s'\n" $(git config --get-all core.filemode)
diff --git a/install_msw.sh b/install_msw.sh
index b93a6b9..906bedb 100755
--- a/install_msw.sh
+++ b/install_msw.sh
@@ -43,6 +43,9 @@ then
export coefficiency='--jobs=4'
fi
+# SOMEDAY !! After testing 'check_git_setup.sh' thoroughly, use its
+# 'case' statement here instead of this 'expr substr' thing.
+
export platform
if [ "$(expr substr $(uname -s) 1 6)" = "CYGWIN" ]
then