From 2bf4d0bb535f4876b1a5ef9033ace3b8af267308 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Thu, 17 Jun 2021 00:42:52 -0300 Subject: scripts/paku: Add pascalize() to recover Homebrew's (broken) naming scheme --- scripts/paku | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'scripts/paku') 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")" -- cgit v1.2.3