Compare commits

...

2 Commits

Author SHA1 Message Date
june
3e760d5ce3
promise-utility: init 2025-03-17 22:27:46 +13:00
june
2f77a3d364
meta: script handles spaces now 2025-03-17 22:27:18 +13:00
2 changed files with 22 additions and 8 deletions

11
Casks/promise-utility.rb Normal file
View File

@ -0,0 +1,11 @@
cask "promise-utility" do
version "4.06.0000.01"
sha256 "4c64abd8f434f669bb43c7a31726f64da12394cd4f5857142886bf5ba477340c"
url "https://dl.breadone.xyz/cask/Promise-Utility-4.06.0000.01.zip"
name "Promise Utility"
desc "Manage Promise Pegasus devices"
homepage "https://promise.com"
app "Promise Utility.app"
end

View File

@ -6,19 +6,20 @@ S3_BUCKET="https://dl.breadone.xyz/cask" # prod
# S3_BUCKET="https://dl.breadone.xyz/homebrew/casks" # staging
# get reported version of app, remove quotes, print just the version
version=$(mdls -name kMDItemVersion $APP_FILE | tr -d '"' | awk '{print $3}')
version=$(mdls -name kMDItemVersion "$APP_FILE" | tr -d '"' | awk '{print $3}')
# just the app file name, eg Things3.app
FILENAME=$(basename $APP_FILE)
FILENAME=$(basename "$APP_FILE")
# remove extension, eg Things3
APP_NAME="${FILENAME%.app}"
APPNAME="${FILENAME%.app}"
APPNAME_TRIM=$(echo $APPNAME | sed 's/^[^=]*= //; s/"//g' | tr ' ' '-') # replace spaces with dashes
# interpolate to final zip name, eg Things3-3.12.5.zip
ZIP_PATH="$APP_NAME-$version.zip"
ZIP_PATH="$APPNAME_TRIM-$version.zip"
# Compress the file
ditto -c -k --sequesterRsrc --keepParent $APP_FILE $ZIP_PATH
ditto -c -k --sequesterRsrc --keepParent "$APP_FILE" $ZIP_PATH
# Get hash of file
hash=$(sha256 $ZIP_PATH | awk '{ print $4 }')
@ -29,14 +30,16 @@ curl -X PUT "$S3_BUCKET/$ZIP_PATH" \
--data-binary "@$ZIP_PATH"
# output (mostly complete) cask file
echo 'cask "'$(echo "$APP_NAME" | tr '[:upper:]' '[:lower:]')'" do' # lowercase appname
echo 'cask "'$(echo "$APPNAME_TRIM" | tr '[:upper:]' '[:lower:]')'" do' # lowercase appname
echo ' version "'$version'"'
echo ' sha256 "'$hash'"'
echo ''
echo ' url "'$S3_BUCKET/$ZIP_PATH'"'
echo ' name "'$APP_NAME'"'
echo ' name "'$APPNAME'"'
echo ' desc "ENTER_DESCRIPTION"'
echo ' homepage "ENTER_HOMEPAGE"'
echo ''
echo ' app "'$FILENAME'"'
echo 'end'
echo 'end'
rm $ZIP_PATH