Smirnov Olexandr
Smirnov Olexandr
ss2316544@gmail.com Add alacritty, bettrscreenlock config & update qtile, nvim, 5 years ago
ss2316544@gmail.com Add alacritty, bettrscreenlock config & update qtile, nvim, 5 years ago
| 1 | #!/bin/sh |
| 2 | add() { |
| 3 | echo $1 >> .gitignore |
| 4 | } |
| 5 | del() { |
| 6 | sed -i "/$1/d" .gitignore |
| 7 | } |
| 8 | edit() { |
| 9 | sed -in "s|$1|$2|g" .gitignore |
| 10 | } |
| 11 | show() { |
| 12 | if [ -f '/usr/bin/bat' ] |
| 13 | then |
| 14 | bat .gitignore |
| 15 | else |
| 16 | cat .gitignore |
| 17 | fi |
| 18 | } |
| 19 | |
| 20 | case "$1" in |
| 21 | add|a) shift; add "$@" ;; |
| 22 | del|d) shift; del "$@" ;; |
| 23 | mv) shift; edit "$@" ;; |
| 24 | show|s) shift; show ;; |
| 25 | help) echo "add/a - filename add to ignore" |
| 26 | echo "del/d - filename del from ignore" |
| 27 | echo "mv - oldname newname chage file name" |
| 28 | echo "show - show ignore file" |
| 29 | ;; |
| 30 | *) echo "Command is not valid" |
| 31 | esac |