Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 6963fa4

Browse files
fix(scripts): use cross-platform POSIX
- Change shebang from `#!/bin/sh` to `#!/usr/bin/env sh` - Set `$PREFIX` depending on OS
1 parent 41bfb6c commit 6963fa4

File tree

2 files changed

+28
-4
lines changed

2 files changed

+28
-4
lines changed

scripts/format

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
1-
#!/usr/bin/env sh -e
1+
#!/usr/bin/env sh
2+
set -e
23

34
export PREFIX="poetry run python -m "
5+
46
if [ -d 'venv' ] ; then
5-
export PREFIX="venv/bin/"
7+
case $(uname -s) in
8+
Linux|FreeBSD|OpenBSD|NetBSD|Darwin)
9+
export PREFIX="venv/bin/"
10+
;;
11+
*MINGW*)
12+
export PREFIX="venv/Scripts/"
13+
;;
14+
*)
15+
exit 1
16+
;;
17+
esac
618
fi
719

820
set -x

scripts/test

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
1-
#!/usr/bin/env sh -e
1+
#!/usr/bin/env sh
2+
set -e
23

34
export PREFIX="poetry run python -m "
5+
46
if [ -d 'venv' ] ; then
5-
export PREFIX="venv/bin/"
7+
case $(uname -s) in
8+
Linux|FreeBSD|OpenBSD|NetBSD|Darwin)
9+
export PREFIX="venv/bin/"
10+
;;
11+
*MINGW*)
12+
export PREFIX="venv/Scripts/"
13+
;;
14+
*)
15+
exit 1
16+
;;
17+
esac
618
fi
719

820
${PREFIX}pytest -n 3 --cov-report term-missing --cov-report=xml:coverage.xml --cov=commitizen tests/

0 commit comments

Comments
 (0)