mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-03-18 13:05:56 +00:00
refactor(dfm): replace per-language install commands with mise
This commit is contained in:
@@ -73,21 +73,18 @@ section_install()
|
|||||||
MENU=(
|
MENU=(
|
||||||
"all:Installs everything in the correct order"
|
"all:Installs everything in the correct order"
|
||||||
"apt-packages:Install apt packages (Debian/Ubuntu)"
|
"apt-packages:Install apt packages (Debian/Ubuntu)"
|
||||||
"cargo:Install rust/cargo packages"
|
|
||||||
"cheat-databases:Install cheat external cheatsheet databases"
|
"cheat-databases:Install cheat external cheatsheet databases"
|
||||||
"composer:Install composer"
|
"composer:Install composer"
|
||||||
"dnf-packages:Install dnf packages (Fedora/RHEL)"
|
"dnf-packages:Install dnf packages (Fedora/RHEL)"
|
||||||
"fonts:Install programming fonts"
|
"fonts:Install programming fonts"
|
||||||
"gh:Install GitHub CLI Extensions"
|
"gh:Install GitHub CLI Extensions"
|
||||||
"git-crypt:Install git-crypt from source"
|
"git-crypt:Install git-crypt from source"
|
||||||
"go:Install Go Packages"
|
|
||||||
"imagick:Install ImageMagick CLI"
|
"imagick:Install ImageMagick CLI"
|
||||||
"macos:Setup nice macOS defaults"
|
"macos:Setup nice macOS defaults"
|
||||||
"npm-packages:Install NPM Packages"
|
"mise:Install tools via mise (runtimes + CLI tools)"
|
||||||
|
"mise-cleanup:Remove old version manager installations (--dry-run supported)"
|
||||||
"ntfy:Install ntfy notification tool"
|
"ntfy:Install ntfy notification tool"
|
||||||
"nvm-latest:Install latest lts node using nvm"
|
"python-libs:Install Python libraries (libtmux, pynvim)"
|
||||||
"nvm:Install Node Version Manager (nvm)"
|
|
||||||
"python-packages:Install Python packages via uv"
|
|
||||||
"shellspec:Install shellspec testing framework"
|
"shellspec:Install shellspec testing framework"
|
||||||
"xcode-cli-tools:Install Xcode CLI tools (macOS)"
|
"xcode-cli-tools:Install Xcode CLI tools (macOS)"
|
||||||
"z:Install z"
|
"z:Install z"
|
||||||
@@ -107,13 +104,10 @@ section_install()
|
|||||||
$0 brew install
|
$0 brew install
|
||||||
$0 install fonts
|
$0 install fonts
|
||||||
|
|
||||||
# Tier 2: Language packages (depend on runtimes from Tier 1)
|
# Tier 2: Runtimes and CLI tools via mise, then remaining installers
|
||||||
$0 install cargo
|
$0 install mise
|
||||||
$0 install go
|
|
||||||
$0 install composer
|
$0 install composer
|
||||||
$0 install nvm
|
$0 install python-libs
|
||||||
$0 install npm-packages
|
|
||||||
$0 install python-packages
|
|
||||||
|
|
||||||
# Tier 3: Tool-dependent installers
|
# Tier 3: Tool-dependent installers
|
||||||
$0 install cheat-databases
|
$0 install cheat-databases
|
||||||
@@ -131,12 +125,6 @@ section_install()
|
|||||||
msgr yay "All done!"
|
msgr yay "All done!"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
cargo)
|
|
||||||
msgr run "Installing cargo packages..."
|
|
||||||
bash "$DOTFILES/scripts/install-cargo-packages.sh" \
|
|
||||||
&& msgr yay "cargo packages installed!"
|
|
||||||
;;
|
|
||||||
|
|
||||||
cheat-databases)
|
cheat-databases)
|
||||||
msgr run "Installing cheat databases..."
|
msgr run "Installing cheat databases..."
|
||||||
for database in "$DOTFILES"/scripts/install-cheat-*.sh; do
|
for database in "$DOTFILES"/scripts/install-cheat-*.sh; do
|
||||||
@@ -163,12 +151,6 @@ section_install()
|
|||||||
&& msgr yay "github cli extensions installed!"
|
&& msgr yay "github cli extensions installed!"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
go)
|
|
||||||
msgr run "Installing Go Packages..."
|
|
||||||
bash "$DOTFILES/scripts/install-go-packages.sh" \
|
|
||||||
&& msgr yay "go packages installed!"
|
|
||||||
;;
|
|
||||||
|
|
||||||
imagick)
|
imagick)
|
||||||
msgr run "Downloading and installing ImageMagick CLI..."
|
msgr run "Downloading and installing ImageMagick CLI..."
|
||||||
curl -L https://imagemagick.org/archive/binaries/magick > "$XDG_BIN_HOME/magick" \
|
curl -L https://imagemagick.org/archive/binaries/magick > "$XDG_BIN_HOME/magick" \
|
||||||
@@ -182,33 +164,21 @@ section_install()
|
|||||||
&& msgr yay "macOS defaults set!"
|
&& msgr yay "macOS defaults set!"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
nvm)
|
mise)
|
||||||
msgr run "Installing nvm..."
|
msgr run "Installing tools via mise..."
|
||||||
local NVM_VERSION
|
if ! command -v mise &> /dev/null; then
|
||||||
NVM_VERSION=$(x-gh-get-latest-version nvm-sh/nvm)
|
msgr nested "Installing mise..."
|
||||||
msgr ok "Latest nvm version: $NVM_VERSION"
|
curl https://mise.run | sh
|
||||||
local NVM_INSTALL="https://raw.githubusercontent.com/nvm-sh/nvm/${NVM_VERSION}/install.sh"
|
export PATH="$HOME/.local/bin:$PATH"
|
||||||
local NVM_CURL="curl -o- \"$NVM_INSTALL\" | bash"
|
|
||||||
PROFILE=/dev/null bash -c "$NVM_CURL"
|
|
||||||
$0 install nvm-latest
|
|
||||||
msgr yay "nvm installed!"
|
|
||||||
;;
|
|
||||||
|
|
||||||
nvm-latest)
|
|
||||||
msgr run "Installing latest lts node..."
|
|
||||||
if [ -n "$NVM_DIR" ]; then
|
|
||||||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
|
|
||||||
fi
|
fi
|
||||||
nvm install --lts --latest-npm --default
|
mise install --yes
|
||||||
git checkout "$DOTFILES/base/zshrc"
|
mise reshim
|
||||||
git checkout "$DOTFILES/base/bashrc"
|
msgr yay "mise tools installed!"
|
||||||
msgr yay "latest lts node installed!"
|
|
||||||
;;
|
;;
|
||||||
|
|
||||||
npm-packages)
|
mise-cleanup)
|
||||||
msgr run "NPM Packages install started..."
|
msgr run "Cleaning up old version manager installations..."
|
||||||
bash "$DOTFILES/scripts/install-npm-packages.sh" \
|
bash "$DOTFILES/scripts/cleanup-old-version-managers.sh" "${2:-}"
|
||||||
&& msgr yay "NPM Packages have been installed!"
|
|
||||||
;;
|
;;
|
||||||
|
|
||||||
apt-packages)
|
apt-packages)
|
||||||
@@ -235,10 +205,10 @@ section_install()
|
|||||||
&& msgr yay "ntfy installed!"
|
&& msgr yay "ntfy installed!"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
python-packages)
|
python-libs)
|
||||||
msgr run "Installing Python packages..."
|
msgr run "Installing Python libraries..."
|
||||||
bash "$DOTFILES/scripts/install-python-packages.sh" \
|
bash "$DOTFILES/scripts/install-python-packages.sh" \
|
||||||
&& msgr yay "Python packages installed!"
|
&& msgr yay "Python libraries installed!"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
xcode-cli-tools)
|
xcode-cli-tools)
|
||||||
|
|||||||
@@ -1,21 +0,0 @@
|
|||||||
# install-cargo-packages
|
|
||||||
|
|
||||||
Install Rust packages defined in the script.
|
|
||||||
|
|
||||||
## Usage
|
|
||||||
|
|
||||||
```bash
|
|
||||||
scripts/install-cargo-packages.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
## What it does
|
|
||||||
|
|
||||||
1. If `cargo-install-update` is available, updates all existing packages first
|
|
||||||
and tracks which packages are already installed.
|
|
||||||
2. Installs each package from the inline list using `cargo install`,
|
|
||||||
skipping any already handled by the update step.
|
|
||||||
Builds run in parallel using available CPU cores (minus two).
|
|
||||||
3. Runs package-specific post-install steps.
|
|
||||||
4. Cleans the cargo cache with `cargo cache --autoclean`.
|
|
||||||
|
|
||||||
To add or remove packages, edit the `packages` array in `scripts/install-cargo-packages.sh`.
|
|
||||||
@@ -1,88 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
set -uo pipefail
|
|
||||||
# @description Install cargo/rust packages.
|
|
||||||
#
|
|
||||||
# shellcheck source=shared.sh
|
|
||||||
source "$DOTFILES/config/shared.sh"
|
|
||||||
|
|
||||||
msgr run "Starting to install rust/cargo packages"
|
|
||||||
|
|
||||||
# Track packages already managed by cargo install-update
|
|
||||||
declare -A installed_packages
|
|
||||||
|
|
||||||
# If we have cargo install-update, use it first
|
|
||||||
if command -v cargo-install-update &> /dev/null; then
|
|
||||||
msgr run "Updating cargo packages with cargo install-update"
|
|
||||||
# Show output in real-time (via stderr) while capturing it for parsing
|
|
||||||
update_output=$(cargo install-update -a 2>&1 | tee /dev/stderr)
|
|
||||||
msgr run_done "Done with cargo install-update"
|
|
||||||
|
|
||||||
# Parse installed package names from the update output
|
|
||||||
while IFS= read -r pkg_name; do
|
|
||||||
[[ -n "$pkg_name" ]] && installed_packages["$pkg_name"]=1
|
|
||||||
done < <(echo "$update_output" | awk '/v[0-9]+\.[0-9]+/ { print $1 }')
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Cargo packages to install
|
|
||||||
packages=(
|
|
||||||
cargo-update # A cargo subcommand for checking and applying updates to installed executables
|
|
||||||
cargo-cache # Cargo cache management utility
|
|
||||||
tree-sitter-cli # An incremental parsing system for programming tools
|
|
||||||
bkt # A subprocess caching utility
|
|
||||||
difftastic # A structural diff that understands syntax
|
|
||||||
fd-find # A simple, fast and user-friendly alternative to 'find'
|
|
||||||
ripgrep # Recursively searches directories for a regex pattern while respecting your gitignore
|
|
||||||
bob-nvim # A version manager for neovim
|
|
||||||
bottom # A cross-platform graphical process/system monitor
|
|
||||||
eza # A modern alternative to ls
|
|
||||||
tmux-sessionizer # A tool for opening git repositories as tmux sessions
|
|
||||||
zoxide # A smarter cd command
|
|
||||||
)
|
|
||||||
|
|
||||||
# Number of jobs to run in parallel, this helps to keep the system responsive
|
|
||||||
BUILD_JOBS=$(nproc --ignore=2 2> /dev/null || sysctl -n hw.ncpu 2> /dev/null || echo 1)
|
|
||||||
|
|
||||||
# Function to install cargo packages
|
|
||||||
install_packages()
|
|
||||||
{
|
|
||||||
for pkg in "${packages[@]}"; do
|
|
||||||
# Skip packages already handled by cargo install-update
|
|
||||||
if [[ -n "${installed_packages[$pkg]+x}" ]]; then
|
|
||||||
msgr ok "Skipping $pkg (already installed)"
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
msgr run "Installing cargo package $pkg"
|
|
||||||
cargo install --jobs "$BUILD_JOBS" "$pkg"
|
|
||||||
msgr run_done "Done installing $pkg"
|
|
||||||
echo ""
|
|
||||||
done
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
# Function to perform additional steps for installed cargo packages
|
|
||||||
post_install_steps()
|
|
||||||
{
|
|
||||||
msgr run "Now doing the next steps for cargo packages"
|
|
||||||
|
|
||||||
# use bob to install latest stable nvim
|
|
||||||
if command -v bob &> /dev/null; then
|
|
||||||
bob use stable && x-path-append "$XDG_DATA_HOME/bob/nvim-bin"
|
|
||||||
fi
|
|
||||||
|
|
||||||
msgr run "Removing cargo cache"
|
|
||||||
cargo cache --autoclean
|
|
||||||
msgr "done" "Done removing cargo cache"
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
# Install cargo packages and run post-install steps
|
|
||||||
main()
|
|
||||||
{
|
|
||||||
install_packages
|
|
||||||
msgr "done" "Installed cargo packages!"
|
|
||||||
post_install_steps
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
main "$@"
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
# install-go-packages
|
|
||||||
|
|
||||||
Install Go packages defined in the script.
|
|
||||||
|
|
||||||
## Usage
|
|
||||||
|
|
||||||
```bash
|
|
||||||
scripts/install-go-packages.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
## What it does
|
|
||||||
|
|
||||||
1. Checks that `go` is available.
|
|
||||||
2. Installs each package from the inline list using `go install`.
|
|
||||||
3. Runs post-install steps (e.g. generating shell completions).
|
|
||||||
4. Clears the Go module and build caches.
|
|
||||||
|
|
||||||
To add or remove packages, edit the `packages` array in `scripts/install-go-packages.sh`.
|
|
||||||
@@ -1,69 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
set -euo pipefail
|
|
||||||
# @description Install Go packages
|
|
||||||
#
|
|
||||||
# shellcheck source=shared.sh
|
|
||||||
source "$DOTFILES/config/shared.sh"
|
|
||||||
|
|
||||||
msgr run "Installing go packages"
|
|
||||||
|
|
||||||
! x-have "go" && msgr err "go hasn't been installed yet." && exit 0
|
|
||||||
|
|
||||||
# Go packages to install
|
|
||||||
packages=(
|
|
||||||
github.com/dotzero/git-profile@latest # Switch between git user profiles
|
|
||||||
github.com/google/yamlfmt/cmd/yamlfmt@latest # Format yaml files
|
|
||||||
github.com/cheat/cheat/cmd/cheat@latest # Interactive cheatsheets on the CLI
|
|
||||||
github.com/charmbracelet/glow@latest # Render markdown on the CLI
|
|
||||||
github.com/junegunn/fzf@latest # General-purpose fuzzy finder
|
|
||||||
github.com/charmbracelet/gum@latest # Glamorous shell scripts
|
|
||||||
github.com/joshmedeski/sesh/v2@latest # Terminal session manager
|
|
||||||
)
|
|
||||||
|
|
||||||
# Function to install go packages
|
|
||||||
install_packages()
|
|
||||||
{
|
|
||||||
for pkg in "${packages[@]}"; do
|
|
||||||
# Strip inline comments and trim whitespace
|
|
||||||
pkg="${pkg%%#*}"
|
|
||||||
pkg="${pkg// /}"
|
|
||||||
[[ -z "$pkg" ]] && continue
|
|
||||||
|
|
||||||
msgr nested "Installing go package: $pkg"
|
|
||||||
go install "$pkg"
|
|
||||||
echo ""
|
|
||||||
done
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
# Function to install completions and run actions for selected packages
|
|
||||||
post_install()
|
|
||||||
{
|
|
||||||
msgr run "Installing completions for selected packages"
|
|
||||||
|
|
||||||
if command -v git-profile &> /dev/null; then
|
|
||||||
git-profile completion zsh > "$ZSH_CUSTOM_COMPLETION_PATH/_git-profile" \
|
|
||||||
&& msgr run_done "Installed completions for git-profile"
|
|
||||||
fi
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
# Function to clear go cache
|
|
||||||
clear_go_cache()
|
|
||||||
{
|
|
||||||
msgr run "Clearing go cache"
|
|
||||||
go clean -cache -modcache
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
# Install go packages, completions, and clear cache
|
|
||||||
main()
|
|
||||||
{
|
|
||||||
install_packages
|
|
||||||
post_install
|
|
||||||
clear_go_cache
|
|
||||||
msgr run_done "Done"
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
main "$@"
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
# install-npm-packages
|
|
||||||
|
|
||||||
Install npm packages defined in the script.
|
|
||||||
|
|
||||||
## Usage
|
|
||||||
|
|
||||||
```bash
|
|
||||||
scripts/install-npm-packages.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
## What it does
|
|
||||||
|
|
||||||
1. Checks that `npm` is available.
|
|
||||||
2. Installs each package from the inline list using `npm install -g`.
|
|
||||||
3. Upgrades all global packages.
|
|
||||||
4. Cleans the npm cache.
|
|
||||||
|
|
||||||
To add or remove packages, edit the `packages` array in `scripts/install-npm-packages.sh`.
|
|
||||||
@@ -1,71 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
set -euo pipefail
|
|
||||||
# @description Install npm packages globally.
|
|
||||||
#
|
|
||||||
# shellcheck source=shared.sh
|
|
||||||
source "$DOTFILES/config/shared.sh"
|
|
||||||
|
|
||||||
msgr msg "Starting to install npm packages"
|
|
||||||
|
|
||||||
if ! command -v npm &> /dev/null; then
|
|
||||||
msgr err "npm could not be found."
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
packages=(
|
|
||||||
editorconfig-checker # Check files against .editorconfig rules
|
|
||||||
github-release-notes # Create release notes from tags and issues
|
|
||||||
neovim # Neovim node client
|
|
||||||
corepack # Node.js package manager version management
|
|
||||||
)
|
|
||||||
|
|
||||||
# Function to install npm packages
|
|
||||||
install_packages()
|
|
||||||
{
|
|
||||||
for pkg in "${packages[@]}"; do
|
|
||||||
# Strip inline comments and trim whitespace
|
|
||||||
pkg="${pkg%%#*}"
|
|
||||||
pkg="${pkg// /}"
|
|
||||||
[[ -z "$pkg" ]] && continue
|
|
||||||
|
|
||||||
if npm ls -g -p "$pkg" &> /dev/null; then
|
|
||||||
msgr run_done "$pkg" "already installed"
|
|
||||||
else
|
|
||||||
msgr run "Installing npm package:" "$pkg"
|
|
||||||
npm install -g --no-fund --no-progress --no-timing "$pkg"
|
|
||||||
fi
|
|
||||||
echo ""
|
|
||||||
done
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
# Function to upgrade all global npm packages
|
|
||||||
upgrade_global_packages()
|
|
||||||
{
|
|
||||||
msgr run "Upgrading all global packages"
|
|
||||||
npm -g --no-progress --no-timing --no-fund outdated || true
|
|
||||||
npm -g --no-timing --no-fund upgrade
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
# Function to clean npm cache
|
|
||||||
clean_npm_cache()
|
|
||||||
{
|
|
||||||
msgr run "Cleaning up npm cache"
|
|
||||||
npm cache verify
|
|
||||||
npm cache clean --force
|
|
||||||
npm cache verify
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
# Install, upgrade, and clean npm packages
|
|
||||||
main()
|
|
||||||
{
|
|
||||||
install_packages
|
|
||||||
upgrade_global_packages
|
|
||||||
clean_npm_cache
|
|
||||||
msgr yay "npm package installations complete"
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
main "$@"
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
# install-python-packages
|
# install-python-packages
|
||||||
|
|
||||||
Install Python packages defined in the script using `uv`.
|
Install Python **libraries** (not tools — those are managed by mise).
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
@@ -11,8 +11,6 @@ scripts/install-python-packages.sh
|
|||||||
## What it does
|
## What it does
|
||||||
|
|
||||||
1. Checks that `uv` is available; if missing, installs it via the official installer.
|
1. Checks that `uv` is available; if missing, installs it via the official installer.
|
||||||
2. Installs each CLI tool from the inline `tools` array using `uv tool install --upgrade`.
|
2. Installs each library from the inline `libraries` array using `uv pip install --system --upgrade`.
|
||||||
3. Installs each library from the inline `libraries` array using `uv pip install --system --upgrade`.
|
|
||||||
4. Upgrades all uv-managed tools with `uv tool upgrade --all`.
|
|
||||||
|
|
||||||
To add or remove packages, edit the `tools` or `libraries` arrays in `scripts/install-python-packages.sh`.
|
To add or remove packages, edit the `libraries` array in `scripts/install-python-packages.sh`.
|
||||||
|
|||||||
@@ -1,53 +1,27 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
# @description Install Python packages using uv.
|
# @description Install Python libraries via uv pip (tools are managed by mise).
|
||||||
#
|
#
|
||||||
# shellcheck source=shared.sh
|
# shellcheck source=shared.sh
|
||||||
source "$DOTFILES/config/shared.sh"
|
source "$DOTFILES/config/shared.sh"
|
||||||
|
|
||||||
msgr run "Starting to install Python packages"
|
msgr run "Starting to install Python libraries"
|
||||||
|
|
||||||
# Ensure uv is available
|
# Ensure uv is available
|
||||||
if ! command -v uv &> /dev/null; then
|
if ! command -v uv &> /dev/null; then
|
||||||
msgr nested "uv not found, installing via official installer"
|
msgr err "uv not found — install it via mise first"
|
||||||
curl -LsSf https://astral.sh/uv/install.sh | sh
|
exit 1
|
||||||
export PATH="$HOME/.local/bin:$PATH"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# CLI tools — installed isolated with `uv tool install`
|
|
||||||
tools=(
|
|
||||||
ansible # IT automation and configuration management
|
|
||||||
openapi-python-client # Generate Python API clients from OpenAPI specs
|
|
||||||
ruff # Fast Python linter and formatter
|
|
||||||
)
|
|
||||||
|
|
||||||
# Library packages — installed into system Python with `uv pip install --system`
|
# Library packages — installed into system Python with `uv pip install --system`
|
||||||
libraries=(
|
libraries=(
|
||||||
libtmux # Python API for tmux
|
libtmux # Python API for tmux
|
||||||
pynvim # Neovim Python client
|
pynvim # Neovim Python client
|
||||||
)
|
)
|
||||||
|
|
||||||
# Function to install CLI tools via uv tool install
|
|
||||||
install_tools()
|
|
||||||
{
|
|
||||||
msgr run "Installing Python CLI tools"
|
|
||||||
for pkg in "${tools[@]}"; do
|
|
||||||
# Strip inline comments and trim whitespace
|
|
||||||
pkg="${pkg%%#*}"
|
|
||||||
pkg="${pkg// /}"
|
|
||||||
[[ -z "$pkg" ]] && continue
|
|
||||||
|
|
||||||
msgr nested "Installing tool: $pkg"
|
|
||||||
uv tool install --upgrade "$pkg"
|
|
||||||
echo ""
|
|
||||||
done
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
# Function to install library packages via uv pip install
|
# Function to install library packages via uv pip install
|
||||||
install_libraries()
|
install_libraries()
|
||||||
{
|
{
|
||||||
msgr run "Installing Python libraries"
|
|
||||||
for pkg in "${libraries[@]}"; do
|
for pkg in "${libraries[@]}"; do
|
||||||
# Strip inline comments and trim whitespace
|
# Strip inline comments and trim whitespace
|
||||||
pkg="${pkg%%#*}"
|
pkg="${pkg%%#*}"
|
||||||
@@ -61,22 +35,5 @@ install_libraries()
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to upgrade all uv-managed tools
|
install_libraries
|
||||||
upgrade_tools()
|
msgr yay "Python library installations complete"
|
||||||
{
|
|
||||||
msgr run "Upgrading all uv-managed tools"
|
|
||||||
uv tool upgrade --all
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
# Install Python tools, libraries, and upgrade all
|
|
||||||
main()
|
|
||||||
{
|
|
||||||
install_tools
|
|
||||||
install_libraries
|
|
||||||
upgrade_tools
|
|
||||||
msgr yay "Python package installations complete"
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
main "$@"
|
|
||||||
|
|||||||
Reference in New Issue
Block a user