20 lines
552 B
Bash
Executable File
20 lines
552 B
Bash
Executable File
#!/bin/bash
|
|
|
|
version="${1:-}"
|
|
csprojPath="${2:-src/StevanFreeborn.Options/StevanFreeborn.Options.csproj}"
|
|
|
|
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"
|