Moved bats windows compatibility changes to separate file

This commit is contained in:
Daylon Wilkins
2019-07-18 14:21:34 -07:00
parent b13cea0dbd
commit ba0044ecea
4 changed files with 29 additions and 52 deletions

View File

@@ -7,25 +7,7 @@ setup() {
export BATS_TMPDIR=$HOME/batstmp/
mkdir $BATS_TMPDIR
fi
skiponwindows() { :; }
unameOut="$(uname -s)"
case "${unameOut}" in
CYGWIN*) machine=Windows;;
MINGW*) machine=Windows;;
*) machine=Unix;;
esac
if [ ${machine} = "Windows" ]; then
pkill() {
taskkill -fi "IMAGENAME eq $2*" -f
}
skiponwindows() {
skip "$1"
}
fi
load $BATS_TEST_DIRNAME/helper/windows-compat.bash
export PATH=$PATH:$GOPATH/bin
export NOMS_VERSION_NEXT=1
cd $BATS_TMPDIR

View File

@@ -0,0 +1,26 @@
skiponwindows() { :; }
unameOut="$(uname -s)"
case "${unameOut}" in
CYGWIN*) machine=Windows;;
MINGW*) machine=Windows;;
*) machine=Unix;;
esac
if [ ${machine} = "Windows" ]; then
skiponwindows() {
skip "$1"
}
fi
if ! [ -x "$(command -v pkill)" ]; then
pkill() {
taskkill -fi "IMAGENAME eq $2*" -f
}
fi
if ! [ -x "$(command -v pgrep)" ]; then
pgrep() {
tasklist -fi "IMAGENAME eq $1*"
}
fi

View File

@@ -5,23 +5,7 @@ setup() {
export BATS_TMPDIR=$HOME/batstmp/
mkdir $BATS_TMPDIR
fi
unameOut="$(uname -s)"
case "${unameOut}" in
CYGWIN*) machine=Windows;;
MINGW*) machine=Windows;;
*) machine=Unix;;
esac
if [ ${machine} = "Windows" ]; then
pkill() {
taskkill -fi "IMAGENAME eq $2*" -f
}
pgrep() {
tasklist -fi "IMAGENAME eq $1*"
}
fi
load $BATS_TEST_DIRNAME/helper/windows-compat.bash
export PATH=$PATH:~/go/bin
export NOMS_VERSION_NEXT=1
cd $BATS_TMPDIR

View File

@@ -3,22 +3,7 @@
setup() {
export PATH=$PATH:~/go/bin
export NOMS_VERSION_NEXT=1
skiponwindows() { :; }
unameOut="$(uname -s)"
case "${unameOut}" in
CYGWIN*) machine=Windows;;
MINGW*) machine=Windows;;
*) machine=Unix;;
esac
if [ ${machine} = "Windows" ]; then
skiponwindows() {
skip "$1"
}
fi
load $BATS_TEST_DIRNAME/helper/windows-compat.bash
cd $BATS_TMPDIR
mkdir "dolt-repo-$$"
cd "dolt-repo-$$"