Skip to content

Commit 488e117

Browse files
committed
feat(Makefile): I've just implemented two new targets into the makefile, publish and rm_branch that flush all the branch and merge with develop when we're sre we're done
1 parent cd8fb40 commit 488e117

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

Makefile

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# By: dlesieur <dlesieur@student.42.fr> +#+ +:+ +#+ #
77
# +#+#+#+#+#+ +#+ #
88
# Created: 2025/10/23 19:03:21 by dlesieur #+# #+# #
9-
# Updated: 2025/11/02 18:03:03 by dlesieur ### ########.fr #
9+
# Updated: 2025/11/06 21:08:06 by dlesieur ### ########.fr #
1010
# #
1111
# **************************************************************************** #
1212

@@ -20,6 +20,7 @@ REMOTE_HOME := $(shell git remote -v | awk 'NR==3 {print $$1}')
2020
CURRENT_BRANCH := $(shell git branch --show-current)
2121
REMOTE_CAMPUS := $(shell git remote -v | awk 'NR==2 {print $$1}')
2222
MSG :=
23+
BRANCH ?=
2324

2425
include variables.mk
2526
-include lib/libft/build/colors.mk
@@ -198,6 +199,33 @@ test-lexer-raw:
198199
test-lexer:
199200
@python3 srcs/test/run_lexer_tests.py
200201

202+
finish:
203+
git add .
204+
git commit
205+
git push
206+
//we save here the branch before checkout
207+
git checkout develop
208+
git merge $(BRANCH_CHECKED_OUT)
209+
git push
210+
MAKE -C rm_branch BRANCH=$(BRANCH_CHECKED_OUT)
211+
212+
rm_branch:
213+
git branch -D $(BRANCH)
214+
git push origin --delete $(BRANCH)
215+
216+
publish:
217+
@git add .
218+
@git commit -m "$(MSG)"
219+
@git push
220+
@echo "Saving current branch name..."
221+
@export BRANCH_CHECKED_OUT=$$(git branch --show-current)
222+
@git checkout develop
223+
@git merge $${BRANCH_CHECKED_OUT}
224+
@git push
225+
@git checkout $${BRANCH_CHECKED_OUT}
226+
@git branch -D $${BRANCH_CHECKED_OUT}
227+
@git push origin --delete $${BRANCH_CHECKED_OUT}
228+
201229
# Auto-run set-hooks on first use (after clone)
202230
ifeq ($(wildcard .init.stamp),)
203231
.PHONY: _auto_init

0 commit comments

Comments
 (0)