aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xscripts/paku8
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/paku b/scripts/paku
index c94a659..3c9e793 100755
--- a/scripts/paku
+++ b/scripts/paku
@@ -161,13 +161,17 @@ EOF
mv "$NIX_OUT" default.nix
}
+pascalize() {
+ awk '{printf "%s", toupper(substr($1,1,1)) substr($1,2)}'
+}
+
gen_homebrew() {
for p in $(jq -r '.packages[] | @base64' < paku.json); do
HOMEBREW_OUT="$(mktemp)"
NAME="$(echo "$p" | base64 --decode | jq -r '.name')"
- NAME_UC="$(echo "$NAME" | tr '[:lower:]' '[:upper:]')"
+ NAME_UC="$(echo "$NAME" | pascalize)"
SUFFIX="$(echo "$p" | base64 --decode | jq -r '.suffix')"
- SUFFIX_UC="$(echo "$SUFFIX" | tr '[:lower:]' '[:upper:]')"
+ SUFFIX_UC="$(echo "$SUFFIX" | cut -c2- | pascalize)"
VERSION="$(echo "$p" | base64 --decode | jq -r '.version')"
TYPE="$(echo "$p" | base64 --decode | jq -r '.type')"
TARBALL_URL="$(tarball_url "$NAME" "$VERSION")"