diff --git a/assets.sh b/assets.sh index 6bc85ad..d7acd04 100755 --- a/assets.sh +++ b/assets.sh @@ -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` diff --git a/deploy.sh b/deploy.sh index 596ce7d..689f642 100755 --- a/deploy.sh +++ b/deploy.sh @@ -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 @@ -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 diff --git a/pot.sh b/pot.sh index e38f233..ce09872 100755 --- a/pot.sh +++ b/pot.sh @@ -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 diff --git a/tag.sh b/tag.sh index f19f9c9..66d1f9e 100755 --- a/tag.sh +++ b/tag.sh @@ -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