Removed /usr/local from CDPATH
[clearscm.git] / rc / client_scripts / cPanel
1 #!/bin/bash
2 ################################################################################
3 #
4 # File:         $RCSfile: cPanel,v $
5 # Revision:     $Revision: 1.0 $
6 # Description:  Client specific start up for cPanel
7 # Author:       Andrew@DeFaria.com
8 # Created:      Fri Nov  8 13:50:01 PST 2013
9 # Modified:     $Date: $
10 # Language:     bash
11 #
12 # (c) Copyright 2013, ClearSCM, Inc., all rights reserved.
13 #
14 ################################################################################
15 prepend_to_path /usr/local/cpanel/build-tools
16 prepend_to_path /usr/local/cpanel/3rdparty/lib/path-bin
17 prepend_to_path /usr/local/cpanel/3rdparty/bin
18 prepend_to_path /usr/local/cpanel/bin
19 append_to_path /usr/local/sbin
20 append_to_path /usr/local/bin
21 append_to_path /usr/sbin
22 append_to_path /opt/cpanel/composer/bin
23 append_to_path /opt/cplint/bin
24 append_to_path /root/bin
25
26 # Useful aliases
27 alias makesb4='pushd $ulc; make -j4 sandbox; popd'
28 # Find code!
29 if [ -d ~/.vscode-server ]; then
30   codePath=$(dirname $(find ~/.vscode-server/bin -name code))
31   if [ -n "$codePath" ]; then
32     append_to_path $codePath
33   else
34     echo "Warning - unable to find code"
35   fi
36 fi
37
38 # Intended to be used for root
39 WIZARD="CPanel"
40
41 #export CDPATH=/usr/local
42 export ulc=/usr/local/cpanel
43 export ulp=/usr/local/cp-monitoring-cpanel-plugin
44 export ulw=/usr/local/cp-monitoring-whm-plugin
45 export ulb=/usr/local/cp-banners-plugin
46 export CPANEL_TEAM='release'
47 # NOTE: To trim down the amount of time for make sandbox, you may define
48 # the environment variable SANDBOX_LOCALES which is a space separated list
49 # of locales to build. You can add the following to your .bash_profile to
50 # only build English and Spanish.
51 #export SANDBOX_LOCALES=en
52
53 # EA Tools
54 export EATOOLS_BUILD_DIR=/usr/local/ea-tools/SOURCES/
55 export EATOOLS_BIN_DIR=/usr/local/ea-tools/SOURCES/
56 export OBS_USERNAME=A.defaria
57
58 #alias ulc="cd /usr/local/cpanel"
59 alias perl="$ulc/3rdparty/bin/perl"
60 alias stencilwatch='npx stencil test --spec --watchAll'
61 alias stencilwatche2e='npx stencil test --spec --e2e --watchAll'
62
63 # Unset PERLTIDY and PERLCRITIC as those variable override looking for
64 # ~/.perltidyrc and ~/.perlcriticrc.
65 unset PERLTIDY
66 unset PERLCRITIC
67
68 # This is a closer call to how cplint is called by merge_request
69 alias cplintm="cplint --branched-from=upstream/$(cat /usr/local/cpanel/.branched_from)"
70
71 # This is the completer function for ulc. This completes any path that comes
72 # after the ulc as a path completion relative to $ulc
73 function _ulc {
74   local cur prev
75
76   COMPREPLY=()
77   cur="${COMP_WORDS[COMP_CWORD]}"
78   prev="${COMP_WORDS[COMP_CWORD-1]}"
79
80   # to be continued
81 } # _ulc
82
83 function ulc {
84   path=$1
85
86   if [ -s "$1" ]; then
87     cd $ulc/$path
88   else
89     cd $ulc
90   fi
91 } # ulc
92
93 function ulp {
94   path=$1
95
96   if [ -s "$1" ]; then
97     cd $ulp/$path
98   else
99     cd $ulp
100   fi
101 } # ulp
102
103
104 function ulw {
105   path=$1
106
107   if [ -s "$1" ]; then
108     cd $ulw/$path
109   else
110     cd $ulw
111   fi
112 } # ulw
113
114 function ulb {
115   path=$1
116
117   if [ -s "$1" ]; then
118     cd $ulb/$path
119   else
120     cd $ulb
121   fi
122 } # ulb
123