Follow upstream changes -- rest
[git-darcs-import.git] / tests / toolbox.sh
blobad690633eba0159b63170ebaceaad5455c8a2d24
1 #!/usr/bin/env bash
2 set -ev
4 # trick: requiring something to fail
5 not () { "$@" && exit 1 || :; }
7 # trick: portably getting the pwd
8 portable_pwd () {
9 if uname | grep -i cygwin > /dev/null; then
10 cygpath -w `pwd`
11 else
12 pwd
15 # setting IFS is an ugly hack for Cygwin
16 # so that the portable_pwd backtick
17 IFS=''
18 DIR=`portable_pwd`
20 # trick: OS-detection (if needed)
21 if echo $OS | grep -i windows; then
22 echo This test does not work on Windows
23 exit 0
26 # set up the repository
27 rm -rf temp1 # another script may have left a mess.
28 mkdir temp1
29 cd temp1
30 darcs init
31 touch foo
32 darcs add foo
33 # trick: hitting 'enter' in interactive darcs record
34 echo n/ | tr / \\012 | darcs record
35 cd ..
36 rm -rf temp1