Last active
August 21, 2020 01:36
-
-
Save dhelbegor/d226dd768dac3ac32f9b to your computer and use it in GitHub Desktop.
creating projects with boilerplates with command line.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# // Init personal configs | |
# adding alias for decreases path virtualenv and exit the project | |
alias er='source .venv/bin/activate; PS1="(`basename \"$VIRTUAL_ENV\"`):/\W$ "' | |
alias deac='deactivate' | |
# Start virtualenvs | |
function Envs(){ | |
# used to create virtualenvs | |
alias wait_env='echo wait creating the env... && sleep 2 && clear' | |
alias done_env='echo done! && sleep 2 && clear' | |
alias env_activate='source .venv/bin/activate; PS1="(`basename \"$VIRTUAL_ENV\"`):/\W$ "' | |
alias env_create='virtualenv -p python3 .venv' | |
alias pip_upgrade='pip install --upgrade pip' | |
alias create_env='wait_env && env_create && env_activate && pip_upgrade && done_env' | |
} | |
Envs | |
# Start personal projects | |
function Projects(){ | |
alias wait_create='echo wait creating the project...' | |
alias done_create='sleep 2 && clear && echo done good work!' | |
function InitDjango(){ | |
# install django | |
alias install_django='pip install django' | |
# variable for boilerplate django | |
alias django_boilerplate='django-admin.py startproject --template=https://github.com/dhelbegor/omelette/archive/master.zip --extension=md --name=Makefile --name=local_settings.py $project_name .' | |
# comand line projects | |
alias create_django='wait_create && install_django && django_boilerplate && chmod +x manage.py && done_create' | |
} | |
InitDjango | |
} | |
Projects | |
# creating django projects with envs | |
# environment | |
function en(){ | |
if [ $1 ]; then | |
project_name=$1 | |
mkdir $project_name | |
cd $project_name | |
create_env && create_django | |
fi | |
} | |
# alias for personal ls | |
alias ls='ls -A' | |
# adding my personal config for python workspace | |
alias ww='cd workspace/python/works' | |
alias wp='cd workspace/python/projects' | |
# // End personal configs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[user] | |
name = dhelbegor | |
email = [email protected] | |
[color] | |
diff = auto | |
status = auto | |
branch = auto | |
interactive = auto | |
ui = auto | |
[color "branch"] | |
current = green bold | |
local = green | |
remote = red bold | |
[color "status"] | |
added = green bold | |
changed = yellow bold | |
untracked = red | |
[alias] | |
st = status | |
ci = commit | |
df = diff | |
co = checkout | |
br = branch | |
lg = log --pretty=oneline --graph --date=short --decorate |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment