Made jira executable
[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='scrum'
47
48 # EA Tools
49 export EATOOLS_BUILD_DIR=~/git/ea-tools/SOURCES/
50 export EATOOLS_BIN_DIR=~/git/ea-tools/SOURCES/
51
52 #alias ulc="cd /usr/local/cpanel"
53 alias perl="$ulc/3rdparty/bin/perl"
54
55 # Unset PERLTIDY and PERLCRITIC as those variable override looking for
56 # ~/.perltidyrc and ~/.perlcriticrc.
57 unset PERLTIDY
58 unset PERLCRITIC
59
60 # This is the completer function for ulc. This completes any path that comes
61 # after the ulc as a path completion relative to $ulc
62 function _ulc {
63   local cur prev
64
65   COMPREPLY=()
66   cur="${COMP_WORDS[COMP_CWORD]}"
67   prev="${COMP_WORDS[COMP_CWORD-1]}"
68
69   # to be continued
70 } # _ulc
71
72 function ulc {
73   path=$1
74
75   if [ -s "$1" ]; then
76     cd $ulc/$path
77   else
78     cd $ulc
79   fi
80 } # ulc
81
82 function ulp {
83   path=$1
84
85   if [ -s "$1" ]; then
86     cd $ulp/$path
87   else
88     cd $ulp
89   fi
90 } # ulp
91
92
93 function ulw {
94   path=$1
95
96   if [ -s "$1" ]; then
97     cd $ulw/$path
98   else
99     cd $ulw
100   fi
101 } # ulw
102
103 function ulb {
104   path=$1
105
106   if [ -s "$1" ]; then
107     cd $ulb/$path
108   else
109     cd $ulb
110   fi
111 } # ulb
112