Skip to content

Commit

Permalink
Merge pull request adobe#161 from adobe/glenn/branch-name
Browse files Browse the repository at this point in the history
Inject correct branch name into package.json
  • Loading branch information
Narciso Jaramillo committed Dec 14, 2012
2 parents f042240 + c2c6dd9 commit 16febaa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ if [ "$BRACKETS_BUILD_NUM" = "" ]; then
export BRACKETS_BUILD_NUM=`git log --oneline | wc -l | tr -d ' '`
fi
brackets_sha=`git log | head -1 | sed -e 's/commit \([0-9a-f]*$\)/\1/'`
brackets_branch_name=`git status | head -1 | sed -e 's/# On branch \(.*\)/\1/'`
popd

# Pull the latest brackets-shell code
Expand Down Expand Up @@ -100,7 +101,7 @@ fi
# Set the build number, branch and sha on the staged build
cat "$packageLocation/package.json" \
| sed "s:\(\"version\"[^\"]*\"[0-9.]*-\)\([0-9*]\)\(\"\):\1$BRACKETS_BUILD_NUM\3:" \
| sed "s:\(\"branch\"[^\"]*\"\)\([^\"]*\)\(\"\):\1$BRACKETS_BRANCH\3:" \
| sed "s:\(\"branch\"[^\"]*\"\)\([^\"]*\)\(\"\):\1$brackets_branch_name\3:" \
| sed "s:\(\"SHA\"[^\"]*\"\)\([^\"]*\)\(\"\):\1$brackets_sha\3:" \
> tmp_package_json.txt
mv tmp_package_json.txt "$packageLocation/package.json"
Expand Down

0 comments on commit 16febaa

Please sign in to comment.