Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .PHONY: fork
- FILES = \
- module files Makefile Dockerfile docker-compose.yml setup.py MANIFEST.in variables .gitignore .pylintrc
- DEST ?= $(dest)
- fork:
- ifeq ($(DEST),)
- @echo 'MISSING "dest=" PARAMETER'
- @echo 'RUN: make fork dest=$${DIRECTORY}'
- else
- @# copy when either directory does not exist, or is empty
- @# skip if a non-empty directory exist
- @# Note this excludes README.md and LICENSE -- you own your own project ;)
- @(([ ! -d "$(DEST)" ] || find "$(DEST)" -prune -type d -empty |grep -q .) \
- && mkdir -p "$(DEST)" \
- && cp -R $(FILES) "$(DEST)/" \
- && touch $(DEST)/README.md \
- || echo "SKIPPING FORK, WON'T OVERWRITE EXISTING DIRECTORY")
- endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement