I am trying to change the name of my file, adding the number of commits and the current branch name on my file before sending it to the repository.
But I get the following error:
./publish_to_artifactory.sh: line 4: local: `rev-parse': not a valid identifier'`
upload() {
local currentBranch=git rev-parse --abbrev-ref HEAD;
local gitNumberOfCommits=git rev-list --count HEAD;
for file in ./../*.ipa; do
mv $file mobile-${currentBranch}-${gitNumberOfCommits};
echo "uploading zeos-mobile-$currentBranch-$gitNumberOfCommits";
curl -X PUT -u $PUBLISH_USER:$PUBLISH_PASS -T mobile-$currentBranch-$gitNumberOfCommits; http://example.com/artifactory/ios-dev-local/ --fail
done
}
upload;
What am I doing wrong?