Newer
Older
dub_jkp / test / issue1651-custom-dub-init-type.sh
@andre2007 andre2007 on 5 Mar 2019 679 bytes Custom init type (#1658)
  1. #!/usr/bin/env bash
  2. . $(dirname "${BASH_SOURCE[0]}")/common.sh
  3. DIR=$(dirname "${BASH_SOURCE[0]}")
  4. packname="custom-dub-init-type-sample"
  5.  
  6. $DUB remove custom-dub-init-dubpackage --non-interactive --version=* 2>/dev/null || true
  7. $DUB init -n $packname --format sdl -t custom-dub-init-dubpackage --skip-registry=all --registry=file://"$DIR"/issue1651-custom-dub-init-type -- --foo=bar
  8.  
  9. function cleanup {
  10. rm -rf $packname
  11. }
  12.  
  13. if [ ! -e $packname/dub.sdl ]; then # it failed
  14. cleanup
  15. die $LINENO 'No dub.sdl file has been generated.'
  16. fi
  17.  
  18. cd $packname
  19. if ! { ${DUB} 2>&1 || true; } | grep -cF 'foo=bar'; then
  20. cd ..
  21. cleanup
  22. die $LINENO 'Custom init type.'
  23. fi
  24. cd ..
  25. cleanup