-
Notifications
You must be signed in to change notification settings - Fork 0
/
bashrc.sh
executable file
·96 lines (66 loc) · 2.41 KB
/
bashrc.sh
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/bin/bash
#***************************[check if already sourced]************************
# 2019 12 01
if [ "$SOURCED_BASH_REPO" != "" ]; then
return
exit
fi
if [ "$SOURCED_BASH_LAST" == "" ]; then
export SOURCED_BASH_LAST=1
else
export SOURCED_BASH_LAST="$(expr "$SOURCED_BASH_LAST" + 1)"
fi
export SOURCED_BASH_REPO="$SOURCED_BASH_LAST"
#***************************[needed external variables]***********************
# 2019 04 21
# REPO_PATH_WORKSPACE
if [ "$REPO_PATH_WORKSPACE" == "" ]; then
echo "Error sourcing \"repo\": \$REPO_PATH_WORKSPACE is not set"
return -1;
fi
if [ ! -d "$REPO_PATH_WORKSPACE" ]; then
echo "Error sourcing \"repo\": path \$REPO_PATH_WORKSPACE does not exist"
return -1;
fi
#***************************[optional external variables]*********************
# 2020 10 11
# REPO_FILE_ADDITIONAL_GIT
# REPO_BASH_DATA_PATH
if [ "$REPO_BASH_DATA_PATH" != "" ] && [ ! -d "$REPO_BASH_DATA_PATH" ]; then
echo -n "Error sourcing \"repo\": "
echo "path \$REPO_BASH_DATA_PATH does not exist"
fi
#***************************[paths and files]*********************************
# 2021 03 24
# current path
export REPO_PATH="$(realpath "$(dirname "${BASH_SOURCE}")" )/"
# load (alternative) data paths
source "${REPO_PATH}scripts/functions/bash_data.sh"
_repo_bash_data_dirs_load
# load and check data dir
if [ "$REPO_PATH_CONFIG" == "" ]; then
REPO_PATH_CONFIG="$(_repo_bash_data_dirs_get --mkdir "repo" \
"${REPO_PATH}config/")"
fi
_repo_bash_data_dirs_check --rmdir "$REPO_PATH_CONFIG" \
"repo" "${REPO_PATH}config/"
# additional (local) git dirs
if [ "$REPO_FILE_ADDITIONAL_GIT" == "" ]; then
export REPO_FILE_ADDITIONAL_GIT="${REPO_PATH_CONFIG}git.txt"
fi
#***************************[source]******************************************
# 2024 01 25
source "${REPO_PATH}scripts/functions/additional_dirs.sh"
source "${REPO_PATH}scripts/functions/diff.sh"
source "${REPO_PATH}scripts/functions/git.sh"
source "${REPO_PATH}scripts/functions/repo.sh"
source "${REPO_PATH}scripts/functions/svn.sh"
source "${REPO_PATH}scripts/functions/filter.sh"
source "${REPO_PATH}scripts/functions/workspace.sh"
source "${REPO_PATH}scripts/help.sh"
source "${REPO_PATH}scripts/help_overview.sh"
source "${REPO_PATH}scripts/list_roboag.sh"
source "${REPO_PATH}scripts/list.sh"
source "${REPO_PATH}scripts/alias.sh"
source "${REPO_PATH}scripts/backward.sh"
_repo_additional_dirs_load