mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-01-26 11:14:08 +00:00
feat(scripts): have is now x-have script
This commit is contained in:
@@ -6,7 +6,7 @@ source "$HOME/.dotfiles/scripts/shared.sh"
|
||||
|
||||
msg "Starting to install rust/cargo packages"
|
||||
|
||||
! have cargo && {
|
||||
[[ $(x-have "cargo") == "1" ]] && {
|
||||
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
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ source "$HOME/.dotfiles/scripts/shared.sh"
|
||||
|
||||
PBB_REQUIRED_TOOLS=(git cheat)
|
||||
for t in ${PBB_REQUIRED_TOOLS[@]}; do
|
||||
! have "$t" && echo "(!) $t is missing, can't continue..." && exit 1
|
||||
[[ $(x-have "$t") == "1" ]] && echo "(!) $t is missing, can't continue..." && exit 1
|
||||
done
|
||||
|
||||
PBB_GIT="https://github.com/dylanaraps/pure-bash-bible.git"
|
||||
|
||||
@@ -6,7 +6,7 @@ source "$HOME/.dotfiles/scripts/shared.sh"
|
||||
|
||||
TLDR_REQUIRED_TOOLS=(git cheat)
|
||||
for t in ${TLDR_REQUIRED_TOOLS[@]}; do
|
||||
! have "$t" && echo "(!) $t is missing, can't continue..." && exit 1
|
||||
[[ $(x-have "$t") == "1" ]] && echo "(!) $t is missing, can't continue..." && exit 1
|
||||
done
|
||||
|
||||
TLDR_GIT="https://github.com/tldr-pages/tldr.git"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
# shellcheck source="shared.sh"
|
||||
source "$HOME/.dotfiles/scripts/shared.sh"
|
||||
|
||||
! have php && msg_err "PHP Not Available, cannot install composer" && exit 0
|
||||
[[ $(x-have "php") == "1" ]] && 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');"
|
||||
|
||||
@@ -6,7 +6,7 @@ source "$HOME/.dotfiles/scripts/shared.sh"
|
||||
|
||||
msg_run "Installing gh (GitHub Client) extensions"
|
||||
|
||||
! have gh \
|
||||
[[ $(x-have "gh") == "1" ]] \
|
||||
&& msg_err "gh (GitHub Client) could not be found, please install it first" \
|
||||
&& exit 0
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ source "$HOME/.dotfiles/scripts/shared.sh"
|
||||
|
||||
msg_run "Installing git-crypt"
|
||||
|
||||
! have git-crypt && {
|
||||
[[ $(x-have "git-crypt") == "1" ]] && {
|
||||
|
||||
REPO_URL="https://github.com/AGWA/git-crypt.git"
|
||||
CHECK_PATH="${XDG_BIN_HOME}/git-crypt"
|
||||
|
||||
@@ -6,7 +6,7 @@ source "$HOME/.dotfiles/scripts/shared.sh"
|
||||
|
||||
msg_run "Installing go packages"
|
||||
|
||||
! have go && msg "go hasn't been installed yet." && exit 0
|
||||
[[ $(x-have "go") == "1" ]] && msg "go hasn't been installed yet." && exit 0
|
||||
|
||||
packages=(
|
||||
# A shell parser, formatter, and interpreter with bash support; includes shfmt
|
||||
|
||||
@@ -11,7 +11,7 @@ NEOFETCH_URL="${NEOFETCH_REPO}/archive/refs/tags/${NEOFETCH_VERSION}.tar.gz"
|
||||
NEOFETCH_TEMP="/tmp/neofetch"
|
||||
NEOFETCH_INSTALL_PREFIX="$HOME/.local"
|
||||
|
||||
have neofetch || {
|
||||
[[ $(x-have "neofetch") == "1" ]] && {
|
||||
LC_ALL=C
|
||||
|
||||
mkdir -p "$NEOFETCH_TEMP" "$NEOFETCH_INSTALL_PREFIX"
|
||||
|
||||
@@ -6,7 +6,7 @@ source "$HOME/.dotfiles/scripts/shared.sh"
|
||||
|
||||
msg "Starting to install npm packages"
|
||||
|
||||
! have npm && msg_err "npm could not be found." && exit 0
|
||||
[[ $(x-have "npm") == "1" ]] && msg_err "npm could not be found." && exit 0
|
||||
|
||||
packages=(
|
||||
# This is a tool to check if your files consider your .editorconfig rules.
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
source "$HOME/.dotfiles/scripts/shared.sh"
|
||||
set -e
|
||||
|
||||
have ntfy && msg "ntfy already installed" && exit 0
|
||||
[[ $(x-have "ntfy") == "0" ]] && msg "ntfy already installed" && exit 0
|
||||
|
||||
case $(dfm check arch) in
|
||||
Linux)
|
||||
|
||||
@@ -6,8 +6,8 @@ source "$HOME/.dotfiles/scripts/shared.sh"
|
||||
|
||||
msg "Starting to install pip packages"
|
||||
|
||||
! have python3 && {
|
||||
msg_err "Could not find python3, something really terrible is going on." && exit 1
|
||||
[[ $(x-have "python3") == "1" ]] && {
|
||||
msg_err "Could not find python3, something really weird is going on." && exit 1
|
||||
}
|
||||
|
||||
packages=(
|
||||
|
||||
@@ -92,7 +92,7 @@ function have_command
|
||||
# usage: have php && php -v
|
||||
function have
|
||||
{
|
||||
bkt -- which -s "$1" >&/dev/null
|
||||
bkt -- which "$1" >&/dev/null
|
||||
}
|
||||
|
||||
function brew_installed
|
||||
|
||||
Reference in New Issue
Block a user