✨ Ask for sudo in dot.fish
This commit is contained in:
parent
715d0ddfed
commit
7c548e23e2
2 changed files with 20 additions and 0 deletions
|
@ -145,6 +145,10 @@ end
|
|||
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
ask_for_sudo
|
||||
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
# Ensure npm is available.
|
||||
|
||||
"$DOT/node/volta.fish"
|
||||
|
|
|
@ -156,3 +156,19 @@ end
|
|||
function cmd_exists -a cmd
|
||||
command -v "$cmd" &>/dev/null
|
||||
end
|
||||
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
function ask_for_sudo
|
||||
sudo -v &>/dev/null
|
||||
|
||||
# Update existing 'sudo' timestamp until this script has finished.
|
||||
#
|
||||
# https://gist.github.com/cowboy/3118588
|
||||
|
||||
while true
|
||||
sudo -n true
|
||||
sleep 60
|
||||
kill -0 "$fish_pid" || exit
|
||||
end &>/dev/null &
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue