src now supports adding and removing
This commit is contained in:
parent
78e95e5be7
commit
f2c85aaf10
1 changed files with 4 additions and 3 deletions
7
src
7
src
|
|
@ -32,10 +32,10 @@ rm_item() {
|
||||||
## and delete the source files afterwards
|
## and delete the source files afterwards
|
||||||
tmp="$srcfile.tmp"
|
tmp="$srcfile.tmp"
|
||||||
|
|
||||||
awk "$$3 != $1 { print }" "$srcfile" > "$tmp"
|
awk "\$3 != \"$1\" { print }" "$srcfile" > "$tmp"
|
||||||
mv "$tmp" "$srcfile"
|
mv "$tmp" "$srcfile"
|
||||||
|
|
||||||
rm -rf "$3"
|
rm -rf "$1"
|
||||||
}
|
}
|
||||||
|
|
||||||
update_gitrepo() {
|
update_gitrepo() {
|
||||||
|
|
@ -142,9 +142,10 @@ case "$1" in
|
||||||
;;
|
;;
|
||||||
"add")
|
"add")
|
||||||
add_item "$2" "$3" "$4"
|
add_item "$2" "$3" "$4"
|
||||||
|
update_item "$2" "$3" "$4"
|
||||||
;;
|
;;
|
||||||
"rm")
|
"rm")
|
||||||
rm_item "$2" "$3" "$4"
|
rm_item "$2"
|
||||||
;;
|
;;
|
||||||
"ls")
|
"ls")
|
||||||
list_all
|
list_all
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue