Skip to content

Commit 5cc09ff

Browse files
committed
feat: virtual env req'd by install-dev-env-scripts.sh
1 parent 83049c7 commit 5cc09ff

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
1212

1313
### Changed
1414

15-
* Nothing
15+
* ```install-dev-env-scripts.sh``` now requires virtual env
1616

1717
### Removed
1818

bin/install-dev-env-scripts.sh

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,35 +11,41 @@ download_script() {
1111
CLF_VERSION=${1:-}
1212
SCRIPT=${2:-}
1313

14-
REPO_DOT_SH=$(command -v repo.sh)
15-
SCRIPT_INSTALL_DIR=$(dirname "$REPO_DOT_SH")
14+
DEST_SCRIPT=${VIRTUAL_ENV}/bin/${SCRIPT}
1615

1716
curl \
1817
-s \
1918
-L \
20-
-o "${SCRIPT_INSTALL_DIR}/${SCRIPT}" \
19+
-o "${DEST_SCRIPT}" \
2120
"https://raw.githubusercontent.com/simonsdave/cloudfeaster/v${CLF_VERSION}/bin/${SCRIPT}"
2221

23-
chmod u+x "${SCRIPT_INSTALL_DIR}/${SCRIPT}"
22+
chmod u+x "${DEST_SCRIPT}"
2423

2524
return 0
2625
}
2726

2827
set -e
29-
set -x
3028

3129
if [ $# != 0 ]; then
3230
echo "usage: $(basename "$0")" >&2
3331
exit 1
3432
fi
3533

36-
REPO_ROOT_DIR=$(git rev-parse --show-toplevel)
34+
if [ "${VIRTUAL_ENV:-}" == "" ]; then
35+
echo "Virtual env not activated - could not find environment variable VIRTUAL_ENV" >&2
36+
exit 2
37+
fi
3738

39+
REPO_ROOT_DIR=$(git rev-parse --show-toplevel)
3840
CLF_VERSION=$(grep cloudfeaster== "${REPO_ROOT_DIR}/setup.py" | sed -e "s|^[[:space:]]*['\"]cloudfeaster==||g" | sed -e "s|['\"].*$||g")
3941

4042
DEV_ENV_VERSION=$(curl -s -L "https://raw.githubusercontent.com/simonsdave/cloudfeaster/v${CLF_VERSION}/.circleci/config.yml" | grep 'image:' | tail -1 | sed -e 's|[[:space:]]*$||g' | sed -e 's|^.*dev-env:||g')
4143
if [ "${DEV_ENV_VERSION}" == "latest" ]; then DEV_ENV_VERSION=master; fi
42-
curl -s -L https://raw.githubusercontent.com/simonsdave/dev-env/${DEV_ENV_VERSION}/bin/install-dev-env.sh | bash -s -- --dev-env-version "${DEV_ENV_VERSION:-}"
44+
INSTALL_DEV_ENV=$(mktemp 2> /dev/null || mktemp -t DAS)
45+
curl -s -L https://raw.githubusercontent.com/simonsdave/dev-env/${DEV_ENV_VERSION}/bin/install-dev-env.sh -o "${INSTALL_DEV_ENV}"
46+
chmod a+x "${INSTALL_DEV_ENV}"
47+
"${INSTALL_DEV_ENV}" --dev-env-version "${DEV_ENV_VERSION:-}"
48+
rm "${INSTALL_DEV_ENV}"
4349

4450
download_script "${CLF_VERSION}" "run-all-spiders.sh"
4551
download_script "${CLF_VERSION}" "run-spider.sh"

0 commit comments

Comments
 (0)