File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,6 +32,17 @@ if [[ ! "$DOWNLOAD_URL" == "https://github.com/"*"/releases/download/v${VERSION}
3232 exit 1
3333fi
3434
35+ VERSION_PATTERN=" ${VERSION// ./ \\ .} "
36+ DOWNLOAD_URL_TEMPLATE=" $( printf ' %s' " $DOWNLOAD_URL " | sed " s/${VERSION_PATTERN} /#{version}/g" ) "
37+ case " $DOWNLOAD_URL_TEMPLATE " in
38+ https://github.com/* /releases/download/v' #{version}' /TrimControl-' #{version}' -arm64.dmg)
39+ ;;
40+ * )
41+ echo " DOWNLOAD_URL must resolve to the version-interpolated TrimControl arm64 DMG." >&2
42+ exit 1
43+ ;;
44+ esac
45+
3546case " $CASK_PATH " in
3647 /* | * ..* )
3748 echo " CASK_PATH must be a relative path inside the tap checkout." >&2
@@ -45,7 +56,6 @@ ruby_literal() {
4556
4657VERSION_LITERAL=" $( ruby_literal " $VERSION " ) "
4758SHA256_LITERAL=" $( ruby_literal " $SHA256 " ) "
48- DOWNLOAD_URL_LITERAL=" $( ruby_literal " $DOWNLOAD_URL " ) "
4959HOMEPAGE_URL_LITERAL=" $( ruby_literal " $HOMEPAGE_URL " ) "
5060
5161FULL_CASK_PATH=" $TAP_PATH /$CASK_PATH "
@@ -56,7 +66,7 @@ cask "trimcontrol" do
5666 version $VERSION_LITERAL
5767 sha256 $SHA256_LITERAL
5868
59- url $DOWNLOAD_URL_LITERAL
69+ url " $DOWNLOAD_URL_TEMPLATE "
6070 name "TrimControl"
6171 desc "Open source and text files in Neovim from Finder"
6272 homepage $HOMEPAGE_URL_LITERAL
You can’t perform that action at this time.
0 commit comments