Skip to content

Commit d704a34

Browse files
committed
Removed activate/deactivate feature since base.sh covers it now
1 parent 7675ea9 commit d704a34

File tree

2 files changed

+5
-47
lines changed

2 files changed

+5
-47
lines changed

README.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,12 @@ after making sure you have the base repo checked out under `$BASE_HOME` director
129129

130130
If you don't want to change your `.bash_profile` at all, you can still turn Base on and off as needed. First, make sure BASE_HOME is set appropriately, ideally in your `.bash_profile`.
131131

132-
Run this command to turn Base on:
132+
Run this command to turn get a shell with Base turned on:
133133

134-
source "$BASE_HOME/base_init.sh"
135-
136-
Run this command to turn Base off:
134+
$BASE_HOME/base.sh shell
137135

138-
base_deactivate
136+
or
137+
$BASE_HOME/base.sh
139138

140139
# **Debugging**
141140

base_init.sh

+1-42
Original file line numberDiff line numberDiff line change
@@ -35,39 +35,6 @@ check_bash_version() {
3535
return $rc
3636
}
3737

38-
base_activate() {
39-
local rc=0
40-
if [[ ! $BASE_HOME ]]; then
41-
printf '%s\n' "ERROR: BASE_HOME is not set"
42-
rc=1
43-
else
44-
local script=$BASE_HOME/base_init.sh
45-
if [[ -f "$script" ]]; then
46-
unset __base_init_sourced__ # bypass the "idempotence" check
47-
source "$script" # which makes sure the script really gets sourced
48-
else
49-
printf '%s\n' "ERROR: Base init script '$script' does not exist"
50-
rc=1
51-
fi
52-
fi
53-
return $rc
54-
}
55-
56-
base_deactivate() {
57-
if [[ $_old_vars_saved ]]; then
58-
PATH=$_old_PATH
59-
PS1=$_old_PS1
60-
[[ $_old_BASE_HOME ]] && BASE_HOME=$_old_BASE_HOME
61-
62-
unset _old_PATH _old_PS1 _old_vars_saved _old_BASE_HOME
63-
unset BASE_OS BASE_HOST BASE_DEBUG BASE_SOURCES
64-
unset -f check_bash_version do_init base_debug base_error set_base_home source_it \
65-
import_libs_and_profiles base_update base_main \
66-
base_deactivate
67-
unset __base_init_sourced__
68-
fi
69-
}
70-
7138
do_init() {
7239
local rc=0
7340
[[ -f $HOME/.base_debug ]] && export BASE_DEBUG=1
@@ -90,14 +57,6 @@ do_init() {
9057
BASE_HOST=$(hostname -s)
9158
export BASE_SOURCES=() BASE_OS BASE_HOST
9259

93-
#
94-
# save variables that need to be restored in deactivate
95-
#
96-
_old_vars_saved=1
97-
_old_PATH=$PATH
98-
_old_PS1=$PS1
99-
_old_BASE_HOME=$BASE_HOME
100-
10160
return $rc
10261
}
10362

@@ -202,7 +161,7 @@ base_main() {
202161
#
203162
# these functions need to be available to user's subprocesses
204163
#
205-
export -f base_update import base_activate base_deactivate
164+
export -f base_update import
206165
}
207166

208167
#

0 commit comments

Comments
 (0)