From afed93f58ab5fc8c7cdb649273885aac94c87a02 Mon Sep 17 00:00:00 2001 From: ducoterra Date: Mon, 1 Nov 2021 09:38:00 -0400 Subject: [PATCH] Add warning to make-update and make-push Add warning before make-update and make-push to alert developers that running the commands might be destructive. Allow cancelling the command up to 3 seconds before continuing. Also explain that merge conflicts warrant a re-run of the command. --- Makefile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 99b0031..7cbfd02 100644 --- a/Makefile +++ b/Makefile @@ -9,14 +9,20 @@ include .gitlab/make/helm.makefile include .gitlab/make/kaniko.makefile include .gitlab/make/truenas.makefile +.PHONY: warning +warning: + @printf "Running a potentially destructive command. If a conflict occurs, fix the conflict and re-run the command.\n" + @printf "Cancel with ctrl + c within 3 seconds." + @sleep 3 + .PHONY: make-update -make-update: +make-update: warning @git stash -git subtree pull --prefix .gitlab git@gitlab.ducoterra.net:services/common.git main --squash @if [-z "$(shell git stash list)"; then git stash pop; fi; .PHONY: make-push -make-push: +make-push: warning @make make-update @git remote add common git@gitlab.ducoterra.net:services/common.git @git subtree push --prefix .gitlab common main