mirror of
https://codeberg.org/hyperreal/bin
synced 2025-01-18 16:23:43 +01:00
fix: don't use jq
This commit is contained in:
parent
53c72c3bf3
commit
532359f356
@ -37,11 +37,6 @@ if ! test -x "$(command -v unzip)"; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
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.
|
# Directory on the local filesystem where the fonts will be installed.
|
||||||
LOCAL_FONT_DIR="${HOME}/.local/share/fonts"
|
LOCAL_FONT_DIR="${HOME}/.local/share/fonts"
|
||||||
|
|
||||||
@ -72,7 +67,7 @@ gum style \
|
|||||||
"$message"
|
"$message"
|
||||||
|
|
||||||
# Read the nerd-font download URLs into an array
|
# 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
|
# 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.
|
# 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 user declines to proceed with installation, print a cancel message.
|
||||||
if gum confirm "Proceed with installation?"; then
|
if gum confirm "Proceed with installation?"; then
|
||||||
if ! gum spin --spinner dot --title "Downloading $selection..." \
|
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"
|
gum_error "Failed to download nerdfont archive $selection"
|
||||||
fi
|
fi
|
||||||
if ! gum spin --spinner dot --title "Installing $selection..." \
|
if ! gum spin --spinner dot --title "Installing $selection..." \
|
||||||
|
20
shell.nix
20
shell.nix
@ -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
|
|
||||||
];
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user