Skip to content

Commit

Permalink
Merge pull request #2 from martybel/make_scripts_call_location_indepe…
Browse files Browse the repository at this point in the history
…ndant

Alteration so you can call the scripts from anywhere
  • Loading branch information
kasparsd committed Sep 3, 2014
2 parents 2eede90 + a864e9b commit 8320417
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 18 deletions.
7 changes: 4 additions & 3 deletions assets.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#!/bin/bash

SLUG=$(basename $(dirname $PWD))
BASEDIR=$(cd `dirname "${BASH_SOURCE[0]}"` && pwd)
SLUG=$(basename $BASEDIR)

# These are needed because this itself is a Git repo
export GIT_WORK_TREE=$(dirname $PWD)/git
export GIT_DIR=$(dirname $PWD)/git/.git
export GIT_WORK_TREE=${BASEDIR}/git
export GIT_DIR=${BASEDIR}/git/.git

assets_exist=`git show-ref refs/heads/assets`

Expand Down
17 changes: 9 additions & 8 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
MSG=${1-'Deploy from git'}
BRANCH=${2-'trunk'}

SLUG=$(basename $(dirname $PWD))
SRC_DIR=$(dirname $PWD)/git
DEST_DIR=$(dirname $PWD)/svn/$BRANCH
BASEDIR=$(cd `dirname "${BASH_SOURCE[0]}"` && pwd)
SLUG=$(basename $BASEDIR)
SRC_DIR=${BASEDIR}/git
DEST_DIR=${BASEDIR}/svn/$BRANCH

# These are needed because this itself is a Git repo
export GIT_WORK_TREE=$(dirname $PWD)/git
export GIT_DIR=$(dirname $PWD)/git/.git
export GIT_WORK_TREE=${BASEDIR}/git
export GIT_DIR=${BASEDIR}/git/.git

# make sure we're deploying from the right dir
if [ ! -d "$SRC_DIR/.git" ]; then
Expand All @@ -19,9 +20,9 @@ if [ ! -d "$SRC_DIR/.git" ]; then
fi

# make sure the SVN repo exists
if [ ! -d "$(dirname $PWD)/svn" ]; then
echo "Coudn't find the SVN repo at $(dirname $PWD)/svn. Trying to create one..."
svn co http://plugins.svn.wordpress.org/$SLUG/ $(dirname $PWD)/svn
if [ ! -d "${BASEDIR}/svn" ]; then
echo "Coudn't find the SVN repo at ${BASEDIR}/svn. Trying to create one..."
svn co http://plugins.svn.wordpress.org/$SLUG/ ${BASEDIR}/svn
exit
fi

Expand Down
10 changes: 6 additions & 4 deletions pot.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
#!/bin/bash

TYPE=${1-'wp-plugin'}
SLUG=$(basename $(dirname $PWD))

BASEDIR=$(cd `dirname "${BASH_SOURCE[0]}"` && pwd)
SLUG=$(basename $BASEDIR)

# These are needed because this itself is a Git repo
export GIT_WORK_TREE=$(dirname $PWD)/git
export GIT_DIR=$(dirname $PWD)/git/.git
export GIT_WORK_TREE=${BASEDIR}/git
export GIT_DIR=${BASEDIR}/git/.git

git checkout -f master

php $PWD/wp-develop/tools/i18n/makepot.php $TYPE $GIT_WORK_TREE $GIT_WORK_TREE/languages/$SLUG.pot
php $BASEDIR/wp-deploy/wp-develop/tools/i18n/makepot.php $TYPE $GIT_WORK_TREE $GIT_WORK_TREE/languages/$SLUG.pot
7 changes: 4 additions & 3 deletions tag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ fi
# args
TAG_NAME=$1

SLUG=$(basename $(dirname $PWD))
BASEDIR=$(cd `dirname "${BASH_SOURCE[0]}"` && pwd)
SLUG=$(basename $BASEDIR)

# These are needed because this itself is a Git repo
export GIT_WORK_TREE=$(dirname $PWD)/git
export GIT_DIR=$(dirname $PWD)/git/.git
export GIT_WORK_TREE=${BASEDIR}/git
export GIT_DIR=${BASEDIR}/git/.git

git checkout -f master
git tag $TAG_NAME
Expand Down

0 comments on commit 8320417

Please sign in to comment.