fix: don't use jq

This commit is contained in:
Jeffrey Serio 2024-11-25 14:52:11 -06:00
parent 53c72c3bf3
commit 532359f356
3 changed files with 2 additions and 28 deletions

1
.envrc
View File

@ -1 +0,0 @@
use nix

View File

@ -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..." \

View File

@ -1,20 +0,0 @@
with import <nixpkgs> { };
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
];
}