irongit

A combination of vim and bash that I find useful

ghostshell/ghost.sh
82 lines1.6 KBBourne Again Shell (bash)
1touch ~/.ghost/secret.sh
2source ~/.ghost/secret.sh
3git config --global core.autocrlf input
4if uname -a | grep -q MINGW;then
5 alias python3=python
6 alias Python=python
7else
8 alias python=python3
9fi
10#alias python=python3
11alias Vim='vim ~/.vimrc'
12alias Gvim='vim ~/.ghost/ghost.vimrc'
13alias Gbash='vim ~/.ghost/ghost.sh'
14alias clip=clip.exe
15alias Bash='vim ~/.bashrc'
16alias Source='source ~/.bashrc'
17alias ghook='~/.ghost/ghook/startproject.sh'
18alias venv='python -m venv venv'
19alias Gsecret='vim ~/.ghost/secret.sh'
20function gcom {
21 local message=$@
22 echo "$message"
23 git add . && git commit -m "$message"
24}
25function vsource() {
26 local start=`pwd`
27 for i in $(seq 1 5);do
28 if ! source venv/**/activate; then
29 cd ..
30 else
31 cd $start
32 break
33 fi
34 done
35}
36function Gpush() {
37 local start=`pwd`
38 cd ~/.ghost
39 gcom $@
40 git push -u origin main
41 cd $start
42}
43function djs() {
44 local start=`pwd`
45 for i in $(seq 1 5);do
46 if test -f manage.py;then
47 python manage.py runserver $1
48 break
49 fi
50 done
51}
52function dj() {
53 local start=`pwd`
54 for i in $(seq 1 5);do
55 if test -f manage.py;then
56 python manage.py $@
57 break
58 fi
59 done
60}
61function Gupdate() {
62 local start=`pwd`
63 cd ~/.ghost && git pull
64 Source
65 cd $start
66}
67function djp() {
68 # start a django project
69 django-admin startproject $@
70}
71function pi {
72 python -m pip install $@
73}
74function pm {
75 python -m $@
76}
77function redis {
78 docker run -p 6379:6379 --name redis -d redis:5
79}
80function redis-cli {
81 docker exec -it redis redis-cli $@
82}