Skip to content

Commit b771883

Browse files
committed
Move path_remove fn into dotfiles script.
1 parent 096c72d commit b771883

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

bin/dotfiles

+11
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,17 @@ function get_os() {
5050
done
5151
}
5252

53+
# Remove an entry from $PATH
54+
# Based on http://stackoverflow.com/a/2108540/142339
55+
function path_remove() {
56+
local arg path
57+
path=":$PATH:"
58+
for arg in "$@"; do path="${path//:$arg:/:}"; done
59+
path="${path%:}"
60+
path="${path#:}"
61+
echo "$path"
62+
}
63+
5364
# Display a fancy multi-select menu.
5465
# Inspired by http://serverfault.com/a/298312
5566
function prompt_menu() {

source/10_misc.sh

-9
This file was deleted.

test/test_path_remove.sh

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/usr/bin/env bash
22
source ~/.dotfiles/source/00_dotfiles.sh
3-
source ~/.dotfiles/source/10_misc.sh
43

54
e_header "$(basename "$0" .sh)"
65

0 commit comments

Comments
 (0)