2021-03-22 10:35:32 +01:00
|
|
|
#!/bin/env sh
|
|
|
|
|
|
|
|
SUDO_PATH=$(command -v sudo)
|
|
|
|
SU_PATH=$(command -v su)
|
|
|
|
|
2021-03-31 07:33:34 +02:00
|
|
|
if [ "$1" = "" -o "$1" = "help" ]; then
|
|
|
|
echo "Usage: [sudo|su root -] $0 COMMAND [ARG]"
|
2021-03-22 10:35:32 +01:00
|
|
|
echo "Permanently installs your .dotfiles/bin scripts into your system for"
|
|
|
|
echo "all users. These system-wide installs are on /usr/local/bin/dotfiles-bin"
|
|
|
|
echo "to ensure that your dotfiles-bin installation doesn't mess up with"
|
2021-03-31 07:33:34 +02:00
|
|
|
echo "other locally-built packages in your Linux system."
|
2021-03-22 10:35:32 +01:00
|
|
|
echo
|
|
|
|
echo "Available commands:"
|
2021-03-31 07:33:34 +02:00
|
|
|
echo "status Checks if the dotfiles-bin installation is there"
|
|
|
|
echo " and also prints out your default install path if"
|
|
|
|
echo " DOTFILES_SYS_INSTALL_PATH isn't found"
|
2021-03-22 10:35:32 +01:00
|
|
|
echo "install quick Install .dotfiles/bin scripts as system-wide"
|
|
|
|
echo " scripts, available for use in /usr/local/bin/dotfiles-bin"
|
|
|
|
echo " Requires root access (atleast with sudo) in order to"
|
|
|
|
echo " copy scripts into there. If ran as non-root user, this"
|
|
|
|
echo " script will attempt to run sudo or su root - as needed."
|
|
|
|
echo " It automatically detects your system for you before doing"
|
|
|
|
echo " anything to /usr/local/bin."
|
|
|
|
echo "install guided Guides you throughout the installation progress, including"
|
|
|
|
echo " choosing dest location. The script will check"
|
|
|
|
echo " file permissions for you"
|
|
|
|
echo "update DOTFILES_SYS_INSTALL_PATH"
|
|
|
|
echo " Update your system-wide scripts install as possibe, may"
|
|
|
|
echo " require root qccess. If the argument left blank, it will"
|
|
|
|
echo " attempt to find your ~/.dotfiles/config/sysbin-path.lock"
|
|
|
|
echo " file and sue the DOTFILES_SYS_INSTALL_PATH variable"
|
|
|
|
echo " Otherwise, this script will assume that you"
|
|
|
|
echo " installed it on /usr/local/bin/dotfiles-bin"
|
|
|
|
echo "uninstall Remove files from /usr/bin/local/dotfiles-bins"
|
2021-03-31 07:33:34 +02:00
|
|
|
echo " and any remaining artifacts."
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ $@ = "status" ]; then
|
|
|
|
if [ ! $DOTFILES_SYS_INSTALL_PATH = "" ]; then
|
|
|
|
echo "Local install: $DOTFILES_SYS_INSTALL_PATH"
|
|
|
|
elif [ -f "$HOME/.dotfiles/config/sysbin-path" ]; then
|
|
|
|
DOTFILES_SYS_IBSTALL_PATH=$(cat "$HOME/.dotfiles/config/sysbin-path")
|
|
|
|
echo "Local install: $DOTFILES_SYS_INSTALL_PATH"
|
|
|
|
else
|
|
|
|
echo "Local install: ✖ Not found"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo "That command isn't supported, yet. See 'system-install help' for details."
|
2021-03-22 10:35:32 +01:00
|
|
|
fi
|