Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SHELL := /bin/bash -o pipefail
- DIR := $(strip $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))))
- # some goals we want to disable parallel make
- NONPARALLEL_GOALS = cleanfd status status-short current-branch hardreset
- ifneq ($(filter $(NONPARALLEL_GOALS), $(MAKECMDGOALS)),)
- #$(info Disabling parallel jobs)
- .NOTPARALLEL:
- endif
- # ... lots more stuff here...
- hardreset: | verify-dangerous $(ALL_LOCAL_DIRS)
- hardreset: SUBCMD = (git checkout -B master && git reset --hard origin/master)
- hardreset: DANGER_OUTPUT = \n\t!!!!This command RESETS all your clones to origin/master!!!!\n\n
- # random 6-char string (use z-base-32 alphabet to avoid ambiguous characters)
- RANDOM_STR := $(shell cat /dev/urandom | LC_ALL=C tr -dc 'ybndrfg8ejkmcpqxot1uwisza345h769' | fold -w 6 | head -n 1 )
- verify-dangerous:
- @echo "WARNING: You're running a potentially destructive command."
- @printf "$(DANGER_OUTPUT)"
- @read -p "Enter '$(RANDOM_STR)' to continue: " ENTRY; if [[ "$$ENTRY" != "$(RANDOM_STR)" ]]; then exit 1; fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement