Newer
Older
dub_jkp / test / issue674-concurrent-dub.sh
@Martin Nowak Martin Nowak on 3 Oct 2015 332 bytes better support concurrent fetch of package
  1. #!/bin/bash
  2.  
  3. set -e -o pipefail
  4.  
  5. TMPDIR=$(mktemp -d $(basename $0).XXXXXX)
  6.  
  7. function cleanup {
  8. rm -rf ${TMPDIR}
  9. }
  10. trap cleanup EXIT
  11.  
  12. cd ${TMPDIR} && $DUB fetch --cache=local bloom &
  13. pid1=$!
  14. sleep 0.5
  15. cd ${TMPDIR} && $DUB fetch --cache=local bloom &
  16. pid2=$!
  17. wait $pid1
  18. wait $pid2
  19. if [ ! -d ${TMPDIR}/bloom* ]; then
  20. exit 1
  21. fi