#!/bin/bash
#
# This script should not change directory, because CI strategically runs
# it from somewhere besides the repository root to prevent Skyfield from
# being imported directly from its source tree.

set -e
if ! command -v assay >/dev/null
then
    cat >&2 <<'EOF'
Error: "assay" command not found

Create a virtual environment and run "pip install -r requirements.txt"
to install all of the tools and libraries for Skyfield development.

EOF
    exit 2
fi
if python --version | grep -q 'Python 2.7'
then
    d=$(python -c 'import skyfield as s; print(s.__file__.rsplit("/", 1)[0])')
    pyflakes "$d"/skyfield/*.py
fi
exec assay --batch skyfield/tests

#!/bin/bash
#
# This script should not change directory, because CI strategically runs
# it from somewhere besides the repository root to prevent Skyfield from
# being imported directly from its source tree.

set -e
if ! command -v assay >/dev/null
then
    cat >&2 <<'EOF'
Error: "assay" command not found

Create a virtual environment and run "pip install -r requirements.txt"
to install all of the tools and libraries for Skyfield development.

EOF
    exit 2
fi
if python --version | grep -q 'Python 2.7'
then
    d=$(python -c 'import skyfield as s; print(s.__file__.rsplit("/", 1)[0])')
    pyflakes "$d"/skyfield/*.py
fi
exec assay --batch skyfield.tests

Switch from path to module name to fix Travis CI
Switch from path to module name to fix Travis CI

So I wound up breaking the Travis CI run, which until a few commits ago
was a bare inline call `assay --batch skyfield.tests`.  When I switched
it to an invocation of `test-code.sh`, to unify the testing experience
and also to have a central place to put a call to pyflakes, I was
inadvertently also switching to `assay --batch skyfield.tests` which
does *not* work from another directory.  So this should fix it.
