Skip to content
Snippets Groups Projects
Commit 716aa8b4 authored by Noah Zoschke's avatar Noah Zoschke
Browse files

detect script improvements; Django => Python/Django; stderr on no detect

parent 9a69793d
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env bash #!/usr/bin/env bash
# bin/name <build-dir> # bin/detect <build-dir>
BUILD_DIR=$1 BUILD_DIR=$1
[ -f $BUILD_DIR/requirements.txt ] || exit 1 # fail fast if no requirements.txt
# 'Django' if there is a [mysite]/settings.py file present; otherwise 'Python' function abort() {
ls $BUILD_DIR/**/settings.py &> /dev/null && echo Django || echo Python echo $1 1>&2
\ No newline at end of file exit 1
}
[ -f $BUILD_DIR/requirements.txt ] || abort "fatal: Not a Python app (no requirements.txt)"
# 'Python/Django' if there is a [mysite]/settings.py file present; otherwise 'Python'
ls $BUILD_DIR/**/settings.py &> /dev/null && echo Python/Django || echo Python
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment