chore(shell): touching the paths again, no regrats

This commit is contained in:
2023-11-13 09:25:58 +02:00
parent a5895abfa0
commit 4699233d46
19 changed files with 59 additions and 111 deletions

View File

@@ -6,7 +6,7 @@ source "$HOME/.dotfiles/scripts/shared.sh"
msg "Starting to install rust/cargo packages"
[[ $(x-have "cargo") == "1" ]] && {
! x-have cargo && {
msg "cargo could not be found. installing cargo with rustup.rs"
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --no-modify-path
}
@@ -53,8 +53,8 @@ msg_done "Installed cargo packages!"
msg_run "Now doing the next steps for cargo packages"
# use bob to install nvim
have bob && {
bob use stable && path_append "$XDG_DATA_HOME/bob/nvim-bin"
x-have bob && {
bob use stable && x-path-append "$XDG_DATA_HOME/bob/nvim-bin"
}
msg_done "All next steps done!"

View File

@@ -5,7 +5,7 @@ source "$HOME/.dotfiles/scripts/shared.sh"
PBB_REQUIRED_TOOLS=(git cheat)
for t in ${PBB_REQUIRED_TOOLS[@]}; do
[[ $(x-have "$t") == "1" ]] && echo "(!) $t is missing, can't continue..." && exit 1
! x-have "$t" && echo "(!) $t is missing, can't continue..." && exit 1
done
PBB_GIT="https://github.com/dylanaraps/pure-bash-bible.git"

View File

@@ -5,7 +5,7 @@ source "$HOME/.dotfiles/scripts/shared.sh"
TLDR_REQUIRED_TOOLS=(git cheat)
for t in ${TLDR_REQUIRED_TOOLS[@]}; do
[[ $(x-have "$t") == "1" ]] && echo "(!) $t is missing, can't continue..." && exit 1
! x-have "$t" && echo "(!) $t is missing, can't continue..." && exit 1
done
TLDR_GIT="https://github.com/tldr-pages/tldr.git"

View File

@@ -4,7 +4,7 @@
# shellcheck source="shared.sh"
source "$HOME/.dotfiles/scripts/shared.sh"
[[ $(x-have "php") == "1" ]] && msg_err "PHP Not Available, cannot install composer" && exit 0
! x-have "php" && msg_err "PHP Not Available, cannot install composer" && exit 0
EXPECTED_CHECKSUM="$(php -r 'copy("https://composer.github.io/installer.sig", "php://stdout");')"
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"

View File

@@ -6,7 +6,7 @@ source "$HOME/.dotfiles/scripts/shared.sh"
msg_run "Installing gh (GitHub Client) extensions"
[[ $(x-have "gh") == "1" ]] \
! x-have "gh" \
&& msg_err "gh (GitHub Client) could not be found, please install it first" \
&& exit 0

View File

@@ -8,7 +8,7 @@ source "$HOME/.dotfiles/scripts/shared.sh"
msg_run "Installing git-crypt"
[[ $(x-have "git-crypt") == "1" ]] && {
x-have "git-crypt" || {
REPO_URL="https://github.com/AGWA/git-crypt.git"
CHECK_PATH="${XDG_BIN_HOME}/git-crypt"

View File

@@ -6,7 +6,7 @@ source "$HOME/.dotfiles/scripts/shared.sh"
msg_run "Installing go packages"
[[ $(x-have "go") == "1" ]] && msg "go hasn't been installed yet." && exit 0
! x-have "go" && msg "go hasn't been installed yet." && exit 0
packages=(
# A shell parser, formatter, and interpreter with bash support; includes shfmt
@@ -44,7 +44,7 @@ done
msg_run "Installing completions for selected packages"
have git-profile && {
x-have git-profile && {
git-profile completion zsh > "$ZSH_CUSTOM_COMPLETION_PATH/_git-profile" \
&& msg_ok "Installed completions for git-profile"
}

View File

@@ -11,7 +11,7 @@ NEOFETCH_URL="${NEOFETCH_REPO}/archive/refs/tags/${NEOFETCH_VERSION}.tar.gz"
NEOFETCH_TEMP="/tmp/neofetch"
NEOFETCH_INSTALL_PREFIX="$HOME/.local"
[[ $(x-have "neofetch") == "1" ]] && {
x-have "neofetch" || {
LC_ALL=C
mkdir -p "$NEOFETCH_TEMP" "$NEOFETCH_INSTALL_PREFIX"

View File

@@ -6,7 +6,7 @@ source "$HOME/.dotfiles/scripts/shared.sh"
msg "Starting to install npm packages"
[[ $(x-have "npm") == "1" ]] && msg_err "npm could not be found." && exit 0
! x-have "npm" && msg_err "npm could not be found." && exit 0
packages=(
# This is a tool to check if your files consider your .editorconfig rules.

View File

@@ -6,7 +6,7 @@
source "$HOME/.dotfiles/scripts/shared.sh"
set -e
[[ $(x-have "ntfy") == "0" ]] && msg "ntfy already installed" && exit 0
x-have "ntfy" && msg "ntfy already installed" && exit 0
case $(dfm check arch) in
Linux)

View File

@@ -6,7 +6,7 @@ source "$HOME/.dotfiles/scripts/shared.sh"
msg "Starting to install pip packages"
[[ $(x-have "python3") == "1" ]] && {
x-have "python3" || {
msg_err "Could not find python3, something really weird is going on." && exit 1
}

View File

@@ -6,7 +6,7 @@
[ "$(uname)" != "Darwin" ] && echo "Not a macOS system" && exit 0
! have xcode-select \
! x-have xcode-select \
&& msg_err "xcode-select could not be found, skipping" \
&& exit 0

View File

@@ -50,21 +50,6 @@ function path_prepend
x-path-prepend "$1"
}
# Create directory if it doesn't exist already
x-dc()
{
dir="$1"
[ $# -eq 0 ] && {
echo "Usage: $0 full/path/to/dir/to/create"
exit 1
}
if [ ! -d "$dir" ]; then
mkdir -p "$dir" && exit 0
fi
}
# Create a new directory and enter it
mkd()
{
@@ -84,31 +69,6 @@ nonascii()
LC_ALL=C grep -n '[^[:print:][:space:]]' "${@}"
}
CONFIG_PATH="$DOTFILES/config"
# Load the shell dotfiles, and then some:
function x-load-config-fn()
{
for FILE in $CONFIG_PATH/{exports,alias,functions}; do
FILENAME="$FILE"
HOST="$(hostname -s)"
# global (exports|alias|functions) FILENAME for all hosts
# shellcheck source=../config/exports
[ -r "$FILENAME" ] && source "$FILENAME"
# global secret FILENAME, git ignored
# shellcheck source=../config/exports-secret
[ -r "$FILENAME-secret" ] && source "$FILENAME-secret"
# host specific (exports|alias|functions) FILENAME
# shellcheck source=../config/exports
[ -r "$FILENAME-$HOST" ] && source "$FILENAME-$HOST"
# host specific (exports|alias|functions) FILENAME, git ignored
# shellcheck source=../config/exports
[ -r "$FILENAME-$HOST-secret" ] && source "$FILENAME-$HOST-secret"
done
}
x-load-config-fn
source "$DOTFILES/local/bin/msgr"
# -- Menu builder -- #