mirror of
https://github.com/webinstall/webi-installers.git
synced 2026-04-21 01:16:39 +00:00
add installers
This commit is contained in:
39
pathman/pathman.bash
Normal file
39
pathman/pathman.bash
Normal file
@@ -0,0 +1,39 @@
|
||||
#!/bin/bash
|
||||
|
||||
# title: Pathman
|
||||
# tagline: cross-platform PATH management for bash, zsh, fish, cmd.exe, and PowerShell
|
||||
# description: |
|
||||
# Works with
|
||||
# - Mac, Windows, Linux
|
||||
# - Bash, Zsh, Fish
|
||||
# - Command, Powershell
|
||||
|
||||
set -e
|
||||
set -u
|
||||
|
||||
# Get arch envs, etc
|
||||
my_url="https://rootprojects.org/pathman/dist/$(uname -s)/$(uname -m)/pathman"
|
||||
curl -fL "$my_url" -o pathman
|
||||
echo ""
|
||||
# Make executable
|
||||
chmod +x ./pathman
|
||||
# Move to ~/.local/bin
|
||||
mkdir -p ~/.local/bin
|
||||
mv ./pathman ~/.local/bin
|
||||
|
||||
# Test if in PATH
|
||||
set +e
|
||||
my_pathman=$(command -v pathman)
|
||||
set -e
|
||||
if [ -n "$my_pathman" ]; then
|
||||
if [ "$my_pathman" != "$HOME/.local/bin/pathman" ]; then
|
||||
echo "a pathman installation (which make take precedence) exists at:"
|
||||
echo " $my_pathman"
|
||||
echo ""
|
||||
fi
|
||||
fi
|
||||
|
||||
# add to ~/.local/bin to PATH even if pathman is elsewhere
|
||||
# TODO pathman needs silent option and debug output (quiet "already exists" output)
|
||||
~/.local/bin/pathman add ~/.local/bin # > /dev/null 2> /dev/null
|
||||
# TODO inform user to add to path, apart from pathman?
|
||||
Reference in New Issue
Block a user