-
-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Made it so the 'g' stub can run the external coverage itself.
- Loading branch information
Showing
2 changed files
with
26 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,34 @@ | ||
#!/usr/bin/env bash | ||
|
||
# USAGE | ||
# | ||
# ./g [python version] [cov [no_delete]] [green options] | ||
|
||
# If the first argument is a version number, use it to run that version of python | ||
PYTHON=python | ||
if [[ -e `which python$1` ]] ; then | ||
PYTHON=python$1 | ||
shift | ||
fi | ||
|
||
$PYTHON -c 'from green.cmdline import main ; main()' $@ | ||
# If the next argument is "cov", run coverage externally | ||
if [[ $1 == "cov" ]] ; then | ||
shift | ||
if [[ $1 == "no_delete" ]] ; then | ||
shift | ||
DELETE="no" | ||
else | ||
DELETE="yes" | ||
fi | ||
coverage run --source green --omit '*/test*,*examples*' -m green.cmdline $@ | ||
echo "" | ||
coverage report -m | ||
if [[ $DELETE == "yes" ]] ; then | ||
rm .coverage | ||
fi | ||
exit | ||
fi | ||
|
||
|
||
# Run the command-line version of green | ||
$PYTHON -m green.cmdline $@ |