Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. .PHONY: fork
  2. FILES = \
  3. module files Makefile Dockerfile docker-compose.yml setup.py MANIFEST.in variables .gitignore .pylintrc
  4. DEST ?= $(dest)
  5. fork:
  6. ifeq ($(DEST),)
  7. @echo 'MISSING "dest=" PARAMETER'
  8. @echo 'RUN: make fork dest=$${DIRECTORY}'
  9. else
  10. @# copy when either directory does not exist, or is empty
  11. @# skip if a non-empty directory exist
  12. @# Note this excludes README.md and LICENSE -- you own your own project ;)
  13. @(([ ! -d "$(DEST)" ] || find "$(DEST)" -prune -type d -empty |grep -q .) \
  14. && mkdir -p "$(DEST)" \
  15. && cp -R $(FILES) "$(DEST)/" \
  16. && touch $(DEST)/README.md \
  17. || echo "SKIPPING FORK, WON'T OVERWRITE EXISTING DIRECTORY")
  18. endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement