Compare commits
No commits in common. "bde8524e25d0c682e1dd8d3859f527a04cb407c2" and "86ac4d34b1d81fca4f11fe089b285873350f3467" have entirely different histories.
bde8524e25
...
86ac4d34b1
@ -77,4 +77,4 @@ steps:
|
|||||||
pull: if-not-exists
|
pull: if-not-exists
|
||||||
commands:
|
commands:
|
||||||
- . $HOME/.bashrc
|
- . $HOME/.bashrc
|
||||||
- trash
|
- trash || true
|
11
trash.sh
11
trash.sh
@ -11,10 +11,7 @@ usage() {
|
|||||||
local func_args=$1
|
local func_args=$1
|
||||||
local func_name="$2"
|
local func_name="$2"
|
||||||
|
|
||||||
if [[ $func_args == 0 ]];
|
if [[ $func_args == 0 ]]; then echo -e "At least one argument required:\n$func_name FILE1 DIR2 ..."; exit 1; fi
|
||||||
then echo -e "At least one argument required:\n$func_name FILE1 DIR2 ..."
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
trash_list() {
|
trash_list() {
|
||||||
@ -22,7 +19,7 @@ trash_list() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
trash_put() {
|
trash_put() {
|
||||||
usage "$#" "${FUNCNAME[0]}"
|
usage "$#" "$0"
|
||||||
|
|
||||||
for FILE in $@; do
|
for FILE in $@; do
|
||||||
# Store old filepath for later restore
|
# Store old filepath for later restore
|
||||||
@ -37,7 +34,7 @@ trash_empty() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
trash_restore() {
|
trash_restore() {
|
||||||
usage "$#" "${FUNCNAME[0]}"
|
usage "$#" "$0"
|
||||||
|
|
||||||
for FILE_TO_RESTORE in "$@"; do
|
for FILE_TO_RESTORE in "$@"; do
|
||||||
# Get old filepath for restore
|
# Get old filepath for restore
|
||||||
@ -52,7 +49,7 @@ trash_restore() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
trash_rm() {
|
trash_rm() {
|
||||||
usage "$#" "${FUNCNAME[0]}"
|
usage "$#" "$0"
|
||||||
#if [[ $# == 0 ]]; then echo -e "At least one argument required:\n$0 FILE1 DIR2 ..."; return 1; fi
|
#if [[ $# == 0 ]]; then echo -e "At least one argument required:\n$0 FILE1 DIR2 ..."; return 1; fi
|
||||||
|
|
||||||
for FILE_TO_REMOVE in "$@"; do
|
for FILE_TO_REMOVE in "$@"; do
|
||||||
|
Loading…
x
Reference in New Issue
Block a user