diff --git a/filesystem/cdpath.nu b/filesystem/cdpath.nu index fc9d0b9..3f47db5 100644 --- a/filesystem/cdpath.nu +++ b/filesystem/cdpath.nu @@ -20,9 +20,9 @@ def-env c [dir = ""] { } let complete_dir = if $complete_dir == "" { - error make {msg: "No such path"} + error make -u {msg: "No such path"} } else if (($complete_dir | path expand | path type) != "dir") { - error make {msg: "Not a directory"} + error make -u {msg: "Not a directory"} } else { ($complete_dir | path expand) } diff --git a/helpers/update_hosts.nu b/helpers/update_hosts.nu index 6cf9f44..e0dd01a 100644 --- a/helpers/update_hosts.nu +++ b/helpers/update_hosts.nu @@ -45,18 +45,19 @@ module hosts { let TMP_FILE = ($TMP_FILE | append $BLACKLIST) - $TMP_FILE | save $OLD_FILE + $TMP_FILE | save /tmp/temphostsfile if ($env.LAST_EXIT_CODE == 0) { + sudo mv /tmp/temphostsfile $OLD_FILE echo "Done!" } else { - error make {msg: "Something went wrong while overwriting the /etc/hosts file"} + error make -u {msg: "Something went wrong while overwriting the /etc/hosts file"} } } } else { echo "No updates available." } } else { - error make {msg: "Failed downloading the hosts file, try again."} + error make -u {msg: "Failed downloading the hosts file, try again."} } } } diff --git a/maths/math_functions.nu b/maths/math_functions.nu index 77f4b4c..d777e7a 100644 --- a/maths/math_functions.nu +++ b/maths/math_functions.nu @@ -30,7 +30,7 @@ def fact [num: int] { seq 2 $num | math product } } else { - error make {msg: "can only calculate non-negative integers"} + error make -u {msg: "can only calculate non-negative integers"} } }