Assorted shell and Python scripts

fix: don't use jq

-1
.envrc
···
-
use nix
+2 -7
nerdfont_installer
···
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"
···
"$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.
···
# 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..." \
-20
shell.nix
···
-
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
-
];
-
}