Skip to content

Commit

Permalink
Limit block to 2023.12.0 only
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeeus committed Dec 8, 2023
1 parent e877bba commit aa6a052
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions get
Original file line number Diff line number Diff line change
Expand Up @@ -86,22 +86,23 @@ if [ -n "$haPath" ]; then
targetYear=$(echo "${targetVersion}" | cut -d "." -f 1)
currentYear=$(echo "${currentVersion}" | cut -d "." -f 1)

if [ "${currentVersion}" == "2023.12.0" ]; then
rm -R "$haPath/custom_components/hacs"
rm -f "$haPath/custom_components/hacs.zip"
error "HACS will not work on version 2023.12.0 of Home Assistant, upgrade to 2023.12.1 (or newer) before re-running this script."
fi

if [ "${currentYear}" -lt "${targetYear}" ]; then
rm -R "$haPath/custom_components/hacs"
rm -f "$haPath/custom_components/hacs.zip"
error "Version ${currentVersion} is not new enough, needs at least ${targetVersion}"
fi


if [ "${currentYear}" == "${targetYear}" ]; then
targetMonth=$(echo "${targetVersion}" | cut -d "." -f 2)
currentMonth=$(echo "${currentVersion}" | cut -d "." -f 2)

if [ "${currentYear}.${currentMonth}" == "2023.12" ]; then
rm -R "$haPath/custom_components/hacs"
rm -f "$haPath/custom_components/hacs.zip"
error "HACS will currently not work on ${currentYear}.${currentMonth} versions of Home Assistant, latest known working version is 2023.11.3"
fi

if [ "${currentMonth}" -lt "${targetMonth}" ]; then
rm -R "$haPath/custom_components/hacs"
rm -f "$haPath/custom_components/hacs.zip"
Expand Down

0 comments on commit aa6a052

Please sign in to comment.