Skip to content

Instantly share code, notes, and snippets.

@kendellfab
kendellfab / GoPath Bin
Created Aug 1, 2013
Add this to $PATH variable to have multiple gopath bin directories.
View GoPath Bin
${GOPATH//://bin:}/bin
@kendellfab
kendellfab / versionswitch.sh
Created Jul 14, 2012
Bash script for changing version code and version name in an android manifest.
View versionswitch.sh
MANIFEST_FILE='AndroidManifest.xml'
VERSIONCODE=`grep versionCode $MANIFEST_FILE | sed 's/.*versionCode="//;s/".*//'`
VERSIONNAME=`grep versionName $MANIFEST_FILE | sed 's/.*versionName="//;s/\.[0-9]*".*//'`
NEWCODE=$BUILD_NUMBER
NEWNAME=$VERSIONNAME.$BUILD_NUMBER
echo "Updating Android build information. New version code: $NEWCODE - New version name: $NEWNAME";
sed -i 's/versionCode *= *"'$VERSIONCODE'"/versionCode="'$NEWCODE'"/; s/versionName *= *"[^"]*"/versionName="'$NEWNAME'"/' $MANIFEST_FILE