From 532359f356f3629cf083de999afb1e125f021962 Mon Sep 17 00:00:00 2001 From: Jeffrey Serio Date: Mon, 25 Nov 2024 14:52:11 -0600 Subject: [PATCH] fix: don't use jq --- .envrc | 1 - nerdfont_installer | 9 ++------- shell.nix | 20 -------------------- 3 files changed, 2 insertions(+), 28 deletions(-) delete mode 100644 .envrc delete mode 100644 shell.nix diff --git a/.envrc b/.envrc deleted file mode 100644 index 1d953f4..0000000 --- a/.envrc +++ /dev/null @@ -1 +0,0 @@ -use nix diff --git a/nerdfont_installer b/nerdfont_installer index 1241a8d..0e2cdcc 100755 --- a/nerdfont_installer +++ b/nerdfont_installer @@ -37,11 +37,6 @@ if ! test -x "$(command -v unzip)"; then exit 1 fi -if ! test -x "$(command -v jq)"; then - echo "Missing dependencies: jq" - exit 1 -fi - # Directory on the local filesystem where the fonts will be installed. LOCAL_FONT_DIR="${HOME}/.local/share/fonts" @@ -72,7 +67,7 @@ gum style \ "$message" # Read the nerd-font download URLs into an array -readarray -t nf_url_array < <(curl --silent "https://api.github.com/repos/ryanoasis/nerd-fonts/releases/latest" | jq '.assets.[].browser_download_url' | tr -d '"' | grep ".zip") +readarray -t nf_url_array < <(curl --silent "https://api.github.com/repos/ryanoasis/nerd-fonts/releases/latest" | grep "browser_download_url" | grep "\.zip" | cut -d : -f 2,3 | tr -d '" ') # Add the nerd-font basenames without file extension suffix into an associative # array, using these as the keys and the download URLs as the values. @@ -98,7 +93,7 @@ selection=$(gum choose --height=10 --limit=1 "${sorted_keys[@]}") # If user declines to proceed with installation, print a cancel message. if gum confirm "Proceed with installation?"; then if ! gum spin --spinner dot --title "Downloading $selection..." \ - -- curl --create-dirs -f -sL -o "${LOCAL_FONT_DIR}/$selection.zip" "${nf_array["$selection"]}"; then + -- curl --create-dirs -f -sL -o "${LOCAL_FONT_DIR}/${selection}.zip" "${nf_array["$selection"]}"; then gum_error "Failed to download nerdfont archive $selection" fi if ! gum spin --spinner dot --title "Installing $selection..." \ diff --git a/shell.nix b/shell.nix deleted file mode 100644 index 17b2668..0000000 --- a/shell.nix +++ /dev/null @@ -1,20 +0,0 @@ -with import { }; - -mkShell { - buildInputs = with pkgs; [ - gum - python312Packages.beautifulsoup4 - python312Packages.black - python312Packages.bpython - python312Packages.docopt - python312Packages.isort - python312Packages.pip - python312Packages.pytest - python312Packages.requests - python312Packages.resend - python312Packages.rich - pyright - shellcheck - shfmt - ]; -}