forked from funkjedi/acf-qtranslate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
31 lines (27 loc) · 1 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
REPO_URL=http://plugins.svn.wordpress.org/acf-qtranslate
WORKING_DIR=/tmp/acf-qtranslate-svn
CURRENT_VERSION=$(shell perl -nle'print $$& if m{(?<=Version: )([0-9]|\.)*(?=\s|$$)}' acf-qtranslate.php)
all:
@echo "Usage:"
@echo
@echo " [make sync]"
@echo " Commits all the latest changes from Github to the Wordpress Plugin Directory."
@echo
@echo " [make release]"
@echo " Creates new release in the Wordpress Plugin Directory and tags release on Github."
@echo
sync:
@rm -rf $(WORKING_DIR)
@svn co $(REPO_URL) $(WORKING_DIR)
@echo "Copying files to trunk"
@git ls-tree -r --name-only HEAD | xargs -t -I file rsync -R --exclude 'Makefile' file $(WORKING_DIR)/trunk/
@cd $(WORKING_DIR)
@svn add trunk/*
@svn status
@svn commit -m "Syncing with Github"
@rm -rf $(WORKING_DIR)
release:
@echo "Creating release tag"
@svn copy $(REPO_URL)/trunk/ $(REPO_URL)/tags/$(CURRENT_VERSION) -m "Tagging version $(CURRENT_VERSION)"
@git tag -a -m "Tagging version $(CURRENT_VERSION)"
@git push --tags origin master