-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions
More file actions
35 lines (29 loc) · 688 Bytes
/
functions
File metadata and controls
35 lines (29 loc) · 688 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
function gitbranch {
branches="$(git branch 2> /dev/null)"
if [[ $? != 0 ]]; then
return
fi
result=$(echo "$branches" | grep '^* ' | grep -o '[^* ][^ ]*')
echo $result
}
function insertpath {
PATH=$(~/.shell_setup/bin/addpath.py --path $1 --at $2)
}
function addpaths {
PATH=$(~/.shell_setup/bin/addpath.py --pathfile $1)
}
function addpath {
PATH=$(~/.shell_setup/bin/addpath.py --path $1 --at 0)
}
function delpath {
PATH=$(~/.shell_setup/bin/delpath.py $1)
}
function mysource {
source ~/.shell_setup/$1
}
function resource {
pushd ~/.shell_setup > /dev/null
source ~/.shell_setup/bashrc
popd > /dev/null
}