Skip to content

Commit

Permalink
fix: handle case where VERSION_ID is not defined (close #3)
Browse files Browse the repository at this point in the history
  • Loading branch information
robinbourianes-kalisio committed Dec 23, 2024
1 parent 94a0e8d commit ffbc28f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- do our best to determine `OS_VERSION` when `VERSION_ID` is not in /etc/os-release
- `run_app_tests` now correctly upload code coverage if asked to
15 changes: 14 additions & 1 deletion kash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,20 @@
. /etc/os-release

OS_ID=$ID
OS_VERSION=$VERSION_ID
OS_VERSION=${VERSION_ID:-}

# VERSION_ID is an optional field, do what we can to deduce when missing
if [[ "$OS_VERSION" = "" ]]; then
case "$OS_ID" in
debian)
OS_VERSION=$(cat /etc/debian_version)
OS_VERSION=${OS_VERSION%%.*}
;;
*)
OS_VERSION=unknown
;;
esac
fi

echo "Running on ${OS_ID}-${OS_VERSION}"

Expand Down

0 comments on commit ffbc28f

Please sign in to comment.