Newer
Older
dub_jkp / test / issue2192-environment-variables.sh
@WebFreak001 WebFreak001 on 14 Feb 2022 864 bytes substitute commands in dub describe output
  1. #!/usr/bin/env bash
  2. . $(dirname "${BASH_SOURCE[0]}")/common.sh
  3.  
  4. if [ -n "${DUB_PACKAGE-}" ]; then
  5. die $LINENO '$DUB_PACKAGE must not be set when running this test!'
  6. fi
  7.  
  8. if ! { $DUB build --force --root "$CURR_DIR/issue2192-environment-variables" --skip-registry=all; }; then
  9. die $LINENO 'Failed to build package with built-in environment variables.'
  10. fi
  11.  
  12. if [ -s "$CURR_DIR/issue2192-environment-variables/package.txt" ]; then
  13. rm "$CURR_DIR/issue2192-environment-variables/package.txt"
  14. else
  15. die $LINENO 'Expected generated package.txt file is missing.'
  16. fi
  17.  
  18. OUTPUT=$($DUB describe --root "$CURR_DIR/issue2192-environment-variables" --skip-registry=all --data=pre-build-commands --data-list)
  19. if [ "$OUTPUT" != "echo 'issue2192-environment-variables' > package.txt" ]; then
  20. die $LINENO 'describe did not contain subtituted values or the correct package name'
  21. fi