Adds replacement for sudo to add !! history syntax

This commit is contained in:
Andrew Gioia 2024-10-02 13:23:43 -04:00
parent 07305a97e8
commit dd4c94128d
Signed by: andrew
GPG Key ID: FC09694A000800C8
2 changed files with 9 additions and 1 deletions

8
fish/functions/sudo.fish Normal file
View File

@ -0,0 +1,8 @@
function sudo --description "Replacement for Bash 'sudo !!' command to run last command using sudo."
if test "$argv" = !!
echo sudo $history[1]
eval command sudo $history[1]
else
command sudo $argv
end
end

View File

@ -5,4 +5,4 @@ init-author-email=andrew@gioia.email
init-license=MIT init-license=MIT
init-author-url=https://andrewgioia.com init-author-url=https://andrewgioia.com
registry=https://registry.npmjs.org/ registry=https://registry.npmjs.org/
//registry.npmjs.org/:_authToken=${NPM_TOKEN} //registry.npmjs.org/:_authToken=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