This repository has been archived on 2023-02-02. You can view files and clone it, but cannot push or open issues or pull requests.
mfgames-locking-cil/scripts/set-build-version.sh

22 lines
402 B
Bash
Raw Normal View History

2021-01-22 00:02:19 +00:00
#!/bin/bash
# This sets the build version using a `Directory.Build.props` at the top-level
# of the project.
# Move into the root directory.
cd $(dirname $0)
cd ..
# Get the version from `package.json`.
VERSION=$(grep '"version":' package.json | cut -f 4 -d '"')
cat > src/Directory.Build.props << EOL
<Project>
<PropertyGroup>
<Version>$VERSION</Version>
</PropertyGroup>
</Project>
EOL