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:
@@ -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...'
|
||||
|
||||
Reference in New Issue
Block a user