-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.functions
60 lines (56 loc) · 1.34 KB
/
.functions
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
### NAVIGATION ###
function p() {
if [ $# -gt 1 ]; then
echo "USAGE: p projectname"
tput setaf 1
echo "Maximum one param!"
tput sgr0
elif [ $# -lt 1 ]; then
echo "USAGE: p projectname"
tput setaf 1
echo "Minimum one param!"
tput sgr0
else
found_it=false
for i in ${PROJECTDIRS[*]}; do
if [ -d $i$1 ]; then
cd $i$1
found_it=true
fi
if [ -f $i$1 ]; then
unzip -q $i$1 -d $i
cd $i${1%.*}
rm -f $i$1
found_it=true
fi
done;
if [ $1 == 'plano' ]; then
cd scheduler.frontend.ng2
found_it=true
fi
if [[ "$found_it" = false ]]; then
tput setaf 1
echo "-------------------------"
echo "Error: Project not found!"
echo "-------------------------"
tput sgr0
fi
fi
}
update_terminal_cwd() {
# Identify the directory using a "file:" scheme URL,
# including the host name to disambiguate local vs.
# remote connections. Percent-escape spaces.
local SEARCH=' '
local REPLACE='%20'
local PWD_URL="file://$HOSTNAME${PWD//$SEARCH/$REPLACE}"
printf '\e]7;%s\a' "$PWD_URL"
}
git () {
local disabled=$(command git config --bool disabled.$1 2>/dev/null)
if ${disabled:-false} ; then
echo "The $1 command is intentionally disabled" >&2
return 1
fi
command git "$@"
}