Skip to content
This repository has been archived by the owner on Aug 9, 2019. It is now read-only.

Commit

Permalink
Warn about root before any task
Browse files Browse the repository at this point in the history
Fixes #13
  • Loading branch information
tuxce committed Jun 2, 2014
1 parent 64dac00 commit ec38666
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 0 additions & 4 deletions src/lib/pkgbuild.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,6 @@ build_package() {
fi

# Build
if (( ! UID )); then
warning $(gettext 'Building package as root is dangerous.\n Please run yaourt as a non-privileged user.')
sleep 2
fi
SRCDEST="$YSRCDEST" PKGDEST="$YPKGDEST" makepkg "${MAKEPKG_ARG[@]}" -s -f -p ./PKGBUILD

if (( $? )); then
Expand Down
6 changes: 5 additions & 1 deletion src/yaourt.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,11 @@ unset MAJOR AUR SEARCH BUILD REFRESH SYSUPGRADE CLEAN \
} &> /dev/null

# makepkg check root
(( ! UID )) && program_arg $A_M "--asroot"
if (( ! UID )); then
warning $(gettext 'Building package as root is dangerous.\n Please run yaourt as a non-privileged user.')
sleep 2
program_arg $A_M "--asroot"
fi

# Explode arguments (-Su -> -S -u)
ARGSANS=("$@")
Expand Down

0 comments on commit ec38666

Please # to comment.