forked from PyCQA/isort
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.env
48 lines (39 loc) · 1012 Bytes
/
.env
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
#!/bin/bash
OPEN_PROJECT_NAME="isort"
if [ "$PROJECT_NAME" = "$OPEN_PROJECT_NAME" ]; then
return
fi
if [ ! -f ".env" ]; then
return
fi
export PROJECT_NAME=$OPEN_PROJECT_NAME
export PROJECT_DIR="$PWD"
# Let's make sure this is a hubflow enabled repo
yes | git hf init >/dev/null 2>/dev/null
# Quick directory switching
alias root="cd $PROJECT_DIR"
alias project="root; cd $PROJECT_NAME"
# Commands
alias test="root; py.test -s"
alias install="_install_project"
alias distribute="python setup.py sdist upload; python setup.py bdist_wheel upload"
alias leave="_leave_project"
function _install_project()
{
CURRENT_DIRECTORY="$PWD"
root
sudo python setup.py install
cp isort_kate_plugin.py ~/.kde/share/apps/kate/pate/isort_plugin.py >/dev/null 2>/dev/null
cd $CURRENT_DIRECTORY
}
function _leave_project()
{
export PROJECT_NAME=""
export PROJECT_DIR=""
unalias root
unalias project
unalias test
unalias install
unalias distribute
unalias leave
}