Permalink
Browse files

refactoring in build scripts

  • Loading branch information...
1 parent 5abcfb8 commit 064f317f1468d0f44547c3ac383dbf16b21ac321 @kerphi committed Aug 26, 2012
View
@@ -60,7 +60,7 @@ clean: dummy
@rm -rf $(path)/server/data/*
@rm -f $(path)/server/logs/*
-release-clean: setup setup-minify minify
+clean-release: setup setup-minify minify
@rm -f $(path)/client/lib/less-*.js
@rm -rf $(path)/client/tests
@rm -rf $(path)/server/tests
@@ -72,15 +72,15 @@ release-clean: setup setup-minify minify
@rm -f $(path)/.jshintignore
@rm -rf $(path)/.git
-release-clean-for-dev: release-clean
+clean-release-for-dev: clean-release
@rm -f $(path)/client/*.min.js
@cat $(path)/client/*.js > $(path)/client/jquery.phpfreechat.js.tmp
@rm -f $(path)/client/*.js
@mv $(path)/client/jquery.phpfreechat.js.tmp $(path)/client/jquery.phpfreechat.js
@rm -f $(path)/client/themes/default/*.less
@rm -f $(path)/client/themes/default/jquery.phpfreechat.min.css
-release-clean-for-prod: release-clean
+clean-release-for-prod: clean-release
@mv $(path)/client/jquery.phpfreechat.min.js $(path)/client/jquery.phpfreechat.min.js.tmp
@rm -f $(path)/client/*.js
@mv $(path)/client/jquery.phpfreechat.min.js.tmp $(path)/client/jquery.phpfreechat.min.js
@@ -91,4 +91,4 @@ release-clean-for-prod: release-clean
release: dummy
- @tools/buildrelease
+ @tools/build-release
@@ -12,26 +12,26 @@ mkdir -p $TMP_DIR
if [ "$1" == "--dev" ]; then
PFC_AN_SUFFIX=""
- PFC_ARCHIVE_NAME="phpfreechat-`$TOOL_PATH/getpfcversion`"
+ PFC_ARCHIVE_NAME="phpfreechat-`$TOOL_PATH/get-version`"
# clone the git with the correct name
rm -rf $TMP_DIR/$PFC_ARCHIVE_NAME
git clone file://$PFC_PATH $TMP_DIR/$PFC_ARCHIVE_NAME
# cleanup the pfc files
cd $TMP_DIR/$PFC_ARCHIVE_NAME
- make release-clean-for-dev
+ make clean-release-for-dev
else
PFC_AN_SUFFIX="-min"
- PFC_ARCHIVE_NAME="phpfreechat-`$TOOL_PATH/getpfcversion`"
+ PFC_ARCHIVE_NAME="phpfreechat-`$TOOL_PATH/get-version`"
# clone the git with the correct name
rm -rf $TMP_DIR/$PFC_ARCHIVE_NAME
git clone file://$PFC_PATH $TMP_DIR/$PFC_ARCHIVE_NAME
# cleanup the pfc files
cd $TMP_DIR/$PFC_ARCHIVE_NAME
- make release-clean-for-prod
+ make clean-release-for-prod
fi
# generate the tar.gz
File renamed without changes.
View
@@ -1,19 +1,19 @@
#!/bin/bash
# restore default file
-git checkout examples/example1.html
+git checkout examples/*.html
# switch to the desired status
if [ "$1" == "--debug" ]; then
- sed -i '/pfc-debug/d' examples/example1.html
- sed -i '/pfc-prod/,/\/pfc-prod/d' examples/example1.html
- sed -i '/pfc-dev/,/\/pfc-dev/d' examples/example1.html
+ sed -i '/pfc-debug/d' examples/*.html
+ sed -i '/pfc-prod/,/\/pfc-prod/d' examples/*.html
+ sed -i '/pfc-dev/,/\/pfc-dev/d' examples/*.html
elif [ "$1" == "--dev" ]; then
- sed -i '/pfc-dev/d' examples/example1.html
- sed -i '/pfc-debug/,/\/pfc-debug/d' examples/example1.html
- sed -i '/pfc-prod/,/\/pfc-prod/d' examples/example1.html
+ sed -i '/pfc-dev/d' examples/*.html
+ sed -i '/pfc-debug/,/\/pfc-debug/d' examples/*.html
+ sed -i '/pfc-prod/,/\/pfc-prod/d' examples/*.html
elif [ "$1" == "--prod" ]; then
- sed -i '/pfc-prod/d' examples/example1.html
- sed -i '/pfc-debug/,/\/pfc-debug/d' examples/example1.html
- sed -i '/pfc-dev/,/\/pfc-dev/d' examples/example1.html
+ sed -i '/pfc-prod/d' examples/*.html
+ sed -i '/pfc-debug/,/\/pfc-debug/d' examples/*.html
+ sed -i '/pfc-dev/,/\/pfc-dev/d' examples/*.html
fi

0 comments on commit 064f317

Please sign in to comment.