Add support for Git for Windows / MINGW users

If you install Git for Windows (https://git-for-windows.github.io/) you get a console
,either CMD or MINTT, which returns MINGW* for uname -s. So if you run blackbox_addadmin
or the other commands, you'll get: "ERROR: Unknown OS. Exiting."

I've simply added MINGW* to the Linux and CYGWIN checks and it seems to work fine.

NOTE: I didn't touch tools/test_functions.sh allthough it should probably be updated as well.
This commit is contained in:
Espen Riskedal
2015-10-29 12:10:58 +01:00
parent 074c0831c0
commit 372a35036f
2 changed files with 7 additions and 7 deletions

View File

@@ -371,7 +371,7 @@ function md5sum_file() {
Darwin )
md5 -r "$1" | awk '{ print $1 }'
;;
Linux | CYGWIN*)
Linux | CYGWIN* | MINGW* )
md5sum "$1" | awk '{ print $1 }'
;;
* )
@@ -387,7 +387,7 @@ function cp_permissions() {
Darwin )
chmod $( stat -f '%p' "$1" ) "${@:2}"
;;
Linux | CYGWIN* )
Linux | CYGWIN* | MINGW* )
chmod --reference "$1" "${@:2}"
;;
* )

View File

@@ -57,7 +57,7 @@ function create_self_deleting_tempfile() {
: "${TMPDIR:=/tmp}"
filename=$(mktemp -t _stacklib_.XXXXXXXX )
;;
Linux | CYGWIN* )
Linux | CYGWIN* | MINGW* )
filename=$(mktemp)
;;
* )
@@ -78,7 +78,7 @@ function create_self_deleting_tempdir() {
: "${TMPDIR:=/tmp}"
filename=$(mktemp -d -t _stacklib_.XXXXXXXX )
;;
Linux | CYGWIN* )
Linux | CYGWIN* | MINGW* )
filename=$(mktemp -d)
;;
* )
@@ -102,7 +102,7 @@ function make_self_deleting_tempfile() {
: "${TMPDIR:=/tmp}"
name=$(mktemp -t _stacklib_.XXXXXXXX )
;;
Linux | CYGWIN* )
Linux | CYGWIN* | MINGW* )
name=$(mktemp)
;;
* )
@@ -124,7 +124,7 @@ function make_tempdir() {
: "${TMPDIR:=/tmp}"
name=$(mktemp -d -t _stacklib_.XXXXXXXX )
;;
Linux | CYGWIN* )
Linux | CYGWIN* | MINGW* )
name=$(mktemp -d)
;;
* )
@@ -164,7 +164,7 @@ function fail_if_in_root_directory() {
exit 1
fi
;;
Linux | CYGWIN* )
Linux | CYGWIN* | MINGW* )
if [[ $(stat -c'%i' / ) == $(stat -c'%i' . ) ]] ; then
echo 'SECURITY ALERT: The current directory is the root directory.'
echo 'Exiting...'