diff options
author | EuAndreh <eu@euandre.org> | 2021-06-17 00:42:52 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2021-06-17 00:42:55 -0300 |
commit | 2bf4d0bb535f4876b1a5ef9033ace3b8af267308 (patch) | |
tree | 84c8b6603f5ee4a494403369c78138efcbeda30a /scripts/paku | |
parent | Formula/: Update versions (diff) | |
download | package-repository-2bf4d0bb535f4876b1a5ef9033ace3b8af267308.tar.gz package-repository-2bf4d0bb535f4876b1a5ef9033ace3b8af267308.tar.xz |
scripts/paku: Add pascalize() to recover Homebrew's (broken) naming scheme
Diffstat (limited to '')
-rwxr-xr-x | scripts/paku | 8 |
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")" |