forked from rmonico/itask
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.zsh_autorun
66 lines (47 loc) · 1.28 KB
/
.zsh_autorun
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
source zsh_autorun_start "$(realpath "$0")" || return 0
_description='Project iTask: Interactive taskwarrior frontend'
_functions=($_functions workon run compile upload clean clean_idea)
_workon_description="Activate virtualenv for this project"
workon() {
source virtualenvwrapper.sh
workon itask
}
_run_description="Run the project"
run() {
local old_pwd="$(pwd)"
cd $base_path
rm -rf __pycache__
python -m itask.itask "$@"
cd "$old_pwd"
}
_compile_description="Compile the project (needs virtualenv activated)"
compile() {
if [ -z "$VIRTUAL_ENV" ]; then
echo "Virtualenv not active"
return 1
fi
local old_pwd="$(pwd)"
cd $base_path
python3 setup.py sdist bdist_wheel
cd "$old_pwd"
}
_upload_description="Upload the project to pypi, compile before (needs virtualenv activated)"
upload() {
if [ -z "$VIRTUAL_ENV" ]; then
echo "Virtualenv not active"
return 1
fi
local old_pwd="$(pwd)"
cd $base_path
twine upload --repository pypi dist/\*
cd "$old_pwd"
}
_clean_description="Clean project binaries"
clean() {
rm -rf build dist iTask.egg-info __pycache
}
_clean_idea_description="Removes .idea and iTask.iml"
clean_idea() {
rm -rf .idea iTask.iml
}
source zsh_autorun_end "$(realpath "$0")"