2026-03-30 21:29:45 -05:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
version="${1:-}"
|
2026-03-30 21:45:40 -05:00
|
|
|
csprojPath="${2:-src/StevanFreeborn.Options/StevanFreeborn.Options.csproj}"
|
2026-03-30 21:29:45 -05:00
|
|
|
|
|
|
|
|
if [[ -z "$version" ]]; then
|
|
|
|
|
echo "Error: Version is required"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
content=$(cat "$csprojPath")
|
|
|
|
|
|
|
|
|
|
if [[ "$content" =~ \<Version\>.*?\</Version\> ]]; then
|
|
|
|
|
content=$(echo "$content" | sed "s|<Version>.*</Version>|<Version>$version</Version>|")
|
|
|
|
|
elif [[ "$content" =~ \<PropertyGroup\> ]]; then
|
|
|
|
|
content=$(echo "$content" | sed "s|<PropertyGroup>|<PropertyGroup>\\n <Version>$version</Version>|")
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
echo "$content" > "$csprojPath"
|