summaryrefslogtreecommitdiff
path: root/stowdots
diff options
context:
space:
mode:
authorRaymaekers Luca <raymaekers.luca@gmail.com>2023-07-24 13:12:17 +0200
committerRaymaekers Luca <raymaekers.luca@gmail.com>2023-07-24 13:12:17 +0200
commitb09e5343bd87f067ffcac123c3a4f4a32f78c6f8 (patch)
treef6be89725177ca77e70340121c91015722e5170f /stowdots
parentbb36f0b5a4894018c6808e45243939e333fd4a30 (diff)
fixed install stow on arch
Diffstat (limited to 'stowdots')
-rwxr-xr-xstowdots7
1 files changed, 4 insertions, 3 deletions
diff --git a/stowdots b/stowdots
index dc056f4..45a3ce5 100755
--- a/stowdots
+++ b/stowdots
@@ -1,6 +1,7 @@
#!/bin/sh
trap "exit 1" EXIT INT
+test "$(id -u)" != 0 && sudo=sudo
die () {
echo "$@" 1>&2
@@ -9,17 +10,17 @@ die () {
if ! stow --version > /dev/null 2>&1
then
die "stow not installed or not found."
- die "install stow?"
+ die "install stow? (arch)"
die -n ">"
test "y" = "$(head -n 1)" &&
- doas pacman -Sy stow ||
+ $sudo pacman -Sy stow ||
exit 1
fi
if [ -n "${MACH:=$1}" ]
then
die "I: stowing for $MACH"
else
- die "E: MACH not set" >&2
+ die "E: MACH not set"
die "Enter valid value for 'MACH'"
die "d(esktop) | s(erver) | l(aptop)"
die -n ">"