mirror of
https://github.com/basecamp/omarchy.git
synced 2026-02-17 15:25:37 +00:00
Turn pkg and cmd functions into bins to avoid PATH issues in subshells
This commit is contained in:
9
bin/omarchy-cmd-missing
Executable file
9
bin/omarchy-cmd-missing
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
for cmd in "$@"; do
|
||||
if ! command -v "$cmd" &>/dev/null; then
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
|
||||
return 1
|
||||
7
bin/omarchy-cmd-present
Executable file
7
bin/omarchy-cmd-present
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
for cmd in "$@"; do
|
||||
command -v "$cmd" &>/dev/null || return 1
|
||||
done
|
||||
|
||||
return 0
|
||||
@@ -14,7 +14,7 @@ for file in ~/.local/share/omarchy/migrations/*.sh; do
|
||||
if [[ ! -f "$STATE_DIR/$filename" && ! -f "$STATE_DIR/skipped/$filename" ]]; then
|
||||
echo -e "\e[32m\nRunning migration (${filename%.sh})\e[0m"
|
||||
|
||||
if bash -e $file; then
|
||||
if bash $file; then
|
||||
touch "$STATE_DIR/$filename"
|
||||
else
|
||||
if gum confirm "Migration ${filename%.sh} failed. Skip and continue?"; then
|
||||
|
||||
7
bin/omarchy-pkg-add
Executable file
7
bin/omarchy-pkg-add
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
for pkg in "$@"; do
|
||||
pacman -Q "$pkg" &>/dev/null || return 1
|
||||
done
|
||||
|
||||
return 0
|
||||
7
bin/omarchy-pkg-drop
Executable file
7
bin/omarchy-pkg-drop
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
for pkg in "$@"; do
|
||||
if pacman -Q "$pkg" &>/dev/null; then
|
||||
sudo pacman -Rns --noconfirm "$pkg"
|
||||
fi
|
||||
done
|
||||
9
bin/omarchy-pkg-missing
Executable file
9
bin/omarchy-pkg-missing
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
for pkg in "$@"; do
|
||||
if ! pacman -Q "$pkg" &>/dev/null; then
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
|
||||
return 1
|
||||
7
bin/omarchy-pkg-present
Executable file
7
bin/omarchy-pkg-present
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
for pkg in "$@"; do
|
||||
pacman -Q "$pkg" &>/dev/null || return 1
|
||||
done
|
||||
|
||||
return 0
|
||||
Reference in New Issue
Block a user