forked from apaka/win-sshfs
-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Martin Dimov
committed
Aug 10, 2015
1 parent
7c4a28b
commit e23318a
Showing
4 changed files
with
46 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,4 @@ TestResults | |
/README.zip | ||
/Dokan | ||
/bluescreenview | ||
/Sshfs/Sshfs/Properties/AssemblyInfo.cs.bak |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
"%SYSTEMDRIVE%\Program Files (x86)\Git\bin\bash.exe" --login version.hook.sh | ||
pause |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash | ||
#Git Post Merge Hook | ||
#--------------------- | ||
#Gets the latest tag info from the git repo and updates the AssemblyInfo.cs file with it. | ||
#This file needs to be place in the .git/hooks/ folder and only works when a git pull is | ||
#made which contains changes in the remote repo. | ||
|
||
PRODUCT="WinSshFS 4every1 edition" | ||
|
||
#get the latest tag info. The 'always' flag will give you a shortened SHA1 if no tag exists. | ||
tag=$(git describe --tags --long) | ||
|
||
#tag="A.B.C.D-X-hash" | ||
echo $tag | ||
|
||
AI="Sshfs/Sshfs/Properties/AssemblyInfo.cs" | ||
|
||
#If no tag has been added only the sha1 will be returned | ||
if [[ $tag=="*.*" ]] | ||
then | ||
IFS='-' read -ra PARTS <<< "$tag" | ||
|
||
IFS='.' read -ra TAG <<< "${PARTS[0]}" | ||
#echo "${TAG[2]}" | ||
#echo "${TAG[3]}" | ||
|
||
IFS='-' read -ra COMMITS <<< "${PARTS[1]}" | ||
#echo "${COMMITS[0]}" | ||
|
||
#This will be the version in the format <major>.<minor>.<build number>.<revision> | ||
version="${TAG[0]}"."${TAG[1]}"."${TAG[2]}"."${TAG[3]}" | ||
echo $version | ||
|
||
#Update the AssemblyVersion and AssemblyFileVersion attribute with the 'version' | ||
sed -i.bak "s/\AssemblyVersion(\".*\")/AssemblyVersion(\"$version\")/g" $AI 2>/dev/null | ||
sed -i.bak "s/\AssemblyFileVersion(\".*\")/AssemblyFileVersion(\"$version\")/g" $AI 2>/dev/null | ||
sed -i.bak "s/AssemblyProduct(\".*\")/AssemblyProduct(\"$PRODUCT $tag\")/g" $AI 2>/dev/null | ||
#cat $AI | ||
fi |