From dd4c94128d8c0d5dd56be32a16c366954a9bf413 Mon Sep 17 00:00:00 2001 From: Andrew Gioia Date: Wed, 2 Oct 2024 13:23:43 -0400 Subject: [PATCH] Adds replacement for sudo to add !! history syntax --- fish/functions/sudo.fish | 8 ++++++++ npm/npmrc | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 fish/functions/sudo.fish diff --git a/fish/functions/sudo.fish b/fish/functions/sudo.fish new file mode 100644 index 0000000..f15f79d --- /dev/null +++ b/fish/functions/sudo.fish @@ -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 diff --git a/npm/npmrc b/npm/npmrc index 478fa13..87118c9 100644 --- a/npm/npmrc +++ b/npm/npmrc @@ -5,4 +5,4 @@ init-author-email=andrew@gioia.email init-license=MIT init-author-url=https://andrewgioia.com registry=https://registry.npmjs.org/ -//registry.npmjs.org/:_authToken=${NPM_TOKEN} +//registry.npmjs.org/:_authToken=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