Newer
Older
dub_jkp / test / dpath-variable.sh
  1. #!/usr/bin/env bash
  2.  
  3. . $(dirname "${BASH_SOURCE[0]}")/common.sh
  4. export DPATH="${CURR_DIR}/dpath-variable/dpath"
  5. rm -rf "$DPATH"
  6. cd "${CURR_DIR}/dpath-variable"
  7. "${DUB}" upgrade
  8.  
  9. if [[ ! -f "$DPATH/dub/packages/gitcompatibledubpackage-1.0.1/gitcompatibledubpackage/dub.json" ]]; then
  10. die $LINENO 'Did not get dependencies installed into $DPATH.'
  11. fi
  12.  
  13. # just for making this shell script easier to write, copy the variable
  14. DPATH_ALIAS="$DPATH"
  15. # unset the variable so DUB doesn't pick it up though
  16. unset DPATH
  17. rm -rf "$DPATH_ALIAS"
  18. echo '{"dubHome":"'"$DPATH_ALIAS"/dub2'"}' > "${CURR_DIR}/dpath-variable/dub.settings.json"
  19.  
  20. function cleanup {
  21. rm "${CURR_DIR}/dpath-variable/dub.settings.json"
  22. }
  23. trap cleanup EXIT
  24.  
  25. "${DUB}" upgrade
  26.  
  27. if [[ ! -f "$DPATH_ALIAS/dub2/packages/gitcompatibledubpackage-1.0.1/gitcompatibledubpackage/dub.json" ]]; then
  28. die $LINENO 'Did not get dependencies installed into dubHome (set from config).'
  29. fi