Compare commits
2 Commits
e2a45d9d30
...
3e760d5ce3
Author | SHA1 | Date | |
---|---|---|---|
![]() |
3e760d5ce3 | ||
![]() |
2f77a3d364 |
11
Casks/promise-utility.rb
Normal file
11
Casks/promise-utility.rb
Normal 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
|
@ -6,19 +6,20 @@ S3_BUCKET="https://dl.breadone.xyz/cask" # prod
|
|||||||
# S3_BUCKET="https://dl.breadone.xyz/homebrew/casks" # staging
|
# S3_BUCKET="https://dl.breadone.xyz/homebrew/casks" # staging
|
||||||
|
|
||||||
# get reported version of app, remove quotes, print just the version
|
# 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
|
# just the app file name, eg Things3.app
|
||||||
FILENAME=$(basename $APP_FILE)
|
FILENAME=$(basename "$APP_FILE")
|
||||||
|
|
||||||
# remove extension, eg Things3
|
# 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
|
# 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
|
# 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
|
# Get hash of file
|
||||||
hash=$(sha256 $ZIP_PATH | awk '{ print $4 }')
|
hash=$(sha256 $ZIP_PATH | awk '{ print $4 }')
|
||||||
@ -29,14 +30,16 @@ curl -X PUT "$S3_BUCKET/$ZIP_PATH" \
|
|||||||
--data-binary "@$ZIP_PATH"
|
--data-binary "@$ZIP_PATH"
|
||||||
|
|
||||||
# output (mostly complete) cask file
|
# 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 ' version "'$version'"'
|
||||||
echo ' sha256 "'$hash'"'
|
echo ' sha256 "'$hash'"'
|
||||||
echo ''
|
echo ''
|
||||||
echo ' url "'$S3_BUCKET/$ZIP_PATH'"'
|
echo ' url "'$S3_BUCKET/$ZIP_PATH'"'
|
||||||
echo ' name "'$APP_NAME'"'
|
echo ' name "'$APPNAME'"'
|
||||||
echo ' desc "ENTER_DESCRIPTION"'
|
echo ' desc "ENTER_DESCRIPTION"'
|
||||||
echo ' homepage "ENTER_HOMEPAGE"'
|
echo ' homepage "ENTER_HOMEPAGE"'
|
||||||
echo ''
|
echo ''
|
||||||
echo ' app "'$FILENAME'"'
|
echo ' app "'$FILENAME'"'
|
||||||
echo 'end'
|
echo 'end'
|
||||||
|
|
||||||
|
rm $ZIP_PATH
|
Loading…
x
Reference in New Issue
Block a user