all repos

dotfiles @ 4f7f44d7f434f0702b2dc8a2108f9b3139dbb56e

i use rach linux btw

dotfiles/bin/giti (view raw)

1
#!/bin/sh
2
add() {
3
    local file="$1"
4
    echo $file >> .gitignore
5
}
6
del() {
7
    local file="$1"
8
    sed -i "/$file/d" .gitignore
9
}
10
edit() {
11
    local oldname="$1"
12
    local newanme="$2"
13
    sed -in "s|$oldname|$newanme|g" .gitignore
14
}
15
show() {
16
    if [ -f '/usr/bin/bat' ]
17
    then
18
        bat .gitignore
19
    else
20
        cat .gitignore
21
    fi
22
}
23
24
case "$1" in
25
    add|a)  shift; add "$@"  ;;
26
    del|d)  shift; del "$@"  ;;
27
    mv)     shift; edit "$@" ;;
28
    show|s) shift; show      ;;
29
    help) echo "add/a - filename add to ignore"
30
          echo "del/d - filename del from ignore"
31
          echo "mv    - oldname newname chage file name"
32
          echo "show  - show ignore file"
33
    ;;
34
    *) echo "Command is not valid"
35
esac