Skip to content

Commit

Permalink
Add activate/deactivate scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
chambbj committed May 31, 2018
1 parent 83acabc commit 0a491fc
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
17 changes: 17 additions & 0 deletions scripts/ci/activate.sh
@@ -0,0 +1,17 @@
#!/bin/bash

# Store existing PDAL env vars and set to this conda env
# so other PDAL installs don't pollute the environment

if [[ -n "$PDAL_DRIVER_PATH" ]]; then
export _CONDA_SET_PDAL_DRIVER_PATH=$PDAL_DRIVER_PATH
fi

export PDAL_DRIVER_PATH=$CONDA_PREFIX/lib

# Support plugins if the plugin directory exists
# i.e if it has been manually created by the user
if [[ ! -d "$PDAL_DRIVER_PATH" ]]; then
unset PDAL_DRIVER_PATH
fi

4 changes: 2 additions & 2 deletions scripts/ci/build.sh
Expand Up @@ -35,5 +35,5 @@ DEACTIVATE_DIR=$PREFIX/etc/conda/deactivate.d
mkdir -p $ACTIVATE_DIR
mkdir -p $DEACTIVATE_DIR

cp $RECIPE_DIR/scripts/activate.sh $ACTIVATE_DIR/pdal-activate.sh
cp $RECIPE_DIR/scripts/deactivate.sh $DEACTIVATE_DIR/pdal-deactivate.sh
cp $RECIPE_DIR/activate.sh $ACTIVATE_DIR/pdal-activate.sh
cp $RECIPE_DIR/deactivate.sh $DEACTIVATE_DIR/pdal-deactivate.sh
9 changes: 9 additions & 0 deletions scripts/ci/deactivate.sh
@@ -0,0 +1,9 @@
#!/bin/bash
# Restore previous PDAL env vars if they were set

unset PDAL_DRIVER_PATH
if [[ -n "$_CONDA_SET_PDAL_DRIVER_PATH" ]]; then
export PDAL_DRIVER_PATH=$_CONDA_SET_PDAL_DRIVER_PATH
unset _CONDA_SET_PDAL_DRIVER_PATH
fi

0 comments on commit 0a491fc

Please sign in to comment.