Skip to content

Commit 7f58142

Browse files
committed
Move the postactivate/postdeactive from a dot-dir back to files
1 parent 25b19d2 commit 7f58142

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

workit.sh

+19-19
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ source $BASEDIR/process_functions.sh
1616
# You can override this setting in your .zshrc
1717
if [ "$WORKIT_HOME" = "" ]
1818
then
19-
WORKIT_HOME=( "$HOME/src" "$HOME/configs" )
19+
WORKIT_HOME=( "$HOME/src" )
2020
export WORKIT_HOME
2121
fi
2222

23-
# Normalize the directory name in case it includes
23+
# Normalize the directory name in case it includes
2424
# relative path components.
25-
# this broke hard for some reason so forget normalizing for now.
26-
# it's probably some sort of subshell thing again, but
25+
# this broke hard for some reason so forget normalizing for now.
26+
# it's probably some sort of subshell thing again, but
2727
# for now just leave it be and look it up later
2828
# for ((i=1;i<=${#WORKIT_HOME};i++)); do
2929
# rpath=$WORKIT_HOME[$i]
@@ -91,10 +91,10 @@ function verify_active_project () {
9191
# source the pre/post hooks
9292
function workit_source_hook () {
9393
scriptname="$1"
94-
95-
if [ -f ".workit/$scriptname" ]
94+
95+
if [ -f "$scriptname" ]
9696
then
97-
source ".workit/$scriptname"
97+
source "$scriptname"
9898
fi
9999
}
100100

@@ -138,9 +138,9 @@ function mkworkit () {
138138

139139
eval "projname=\$$#"
140140

141-
proj_workit_path="$proj_path/$projname/.workit"
141+
proj_workit_path="$proj_path/$projname/"
142142

143-
# test for existing proj dir, if not create it, otherwise add
143+
# test for existing proj dir, if not create it, otherwise add
144144
# the post* script files to the existing dir
145145
if [ ! -d $proj_workit_path ]
146146
then
@@ -153,7 +153,7 @@ function mkworkit () {
153153

154154
touch "$proj_workit_path/postactivate" &&
155155
touch "$proj_workit_path/postdeactivate" &&
156-
chmod +x "$proj_workit_path/postactivate" "$proj_workit_path/postdeactivate"
156+
chmod +x "$proj_workit_path/postactivate" "$proj_workit_path/postdeactivate"
157157

158158
# If they passed a help option or got an error from virtualenv,
159159
# the environment won't exist. Use that to tell whether
@@ -220,7 +220,7 @@ function workit () {
220220
then
221221
deactivate
222222
fi
223-
223+
224224
cd $PROJ_PATH
225225

226226
# Save the deactivate function from virtualenv
@@ -232,9 +232,9 @@ function workit () {
232232
# # any settings made by the local postactivate first.
233233
# virtualenvwrapper_source_hook "$VIRTUAL_ENV/bin/predeactivate"
234234
# virtualenvwrapper_source_hook "$WORKON_HOME/predeactivate"
235-
#
235+
#
236236
# env_postdeactivate_hook="$VIRTUAL_ENV/bin/postdeactivate"
237-
#
237+
#
238238
# # Restore the original definition of deactivate
239239
# eval "$virtualenvwrapper_saved_deactivate"
240240
@@ -244,15 +244,15 @@ function workit () {
244244
# virtualenvwrapper_source_hook "$env_postdeactivate_hook"
245245
workit_source_hook "postdeactivate"
246246
}'
247-
247+
248248
workit_source_hook "postactivate"
249-
# workit_source_hook "$project/postactivate"
250-
249+
# workit_source_hook "$project/postactivate"
250+
251251
return 0
252252
}
253253

254254
#
255-
# Set up tab completion. (Adapted from Arthur Koziel's version at
255+
# Set up tab completion. (Adapted from Arthur Koziel's version at
256256
# http://arthurkoziel.com/2008/10/11/virtualenvwrapper-bash-completion/)
257-
#
258-
compctl -g "`show_workit_projects`" workit
257+
#
258+
compctl -g "`show_workit_projects`" workit

0 commit comments

Comments
 (0)