bin/ -> scripts/
This commit is contained in:
parent
c47ffb218e
commit
5cc46a4f22
28
scripts/org-clean
Executable file
28
scripts/org-clean
Executable file
|
@ -0,0 +1,28 @@
|
|||
#!/bin/sh
|
||||
|
||||
## Location where org-mode stores attachments
|
||||
ORG_DIR="$HOME/Dropbox/org/"
|
||||
DATA_DIR="$ORG_DIR/.attach";
|
||||
|
||||
echo "The following files appear orphaned:";
|
||||
|
||||
files=$(find "$DATA_DIR" -type f|perl -ne 'print "$1\n" if /([^\/]*)\/[^\/]*$/'|uniq|while read id; do grep -qiR --include "*.org" "$id" "$ORG_DIR" || find "$DATA_DIR" -ipath "*$id*" -type f; done)
|
||||
|
||||
echo "$files"
|
||||
|
||||
if [ "" == "$files" ]; then
|
||||
echo "Nothing to do!"
|
||||
exit
|
||||
fi
|
||||
|
||||
echo "Delete? y/[n]"
|
||||
read delete
|
||||
case $delete in
|
||||
y)
|
||||
echo "$files" | while read fn; do rm "$fn"; done
|
||||
echo "Done."
|
||||
;;
|
||||
*)
|
||||
echo "Not deleting anything!"
|
||||
;;
|
||||
esac
|
|
@ -1,13 +0,0 @@
|
|||
#compdef lsarchive
|
||||
#autoload
|
||||
|
||||
#
|
||||
# Completes lsarchive.
|
||||
#
|
||||
# Authors:
|
||||
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
||||
#
|
||||
|
||||
_arguments \
|
||||
'(-v --verbose)'{-v,--remove}'[verbose archive listing]' \
|
||||
"*::archive file:_files -g '(#i)*.(tar|tgz|tbz|tbz2|txz|tlz|gz|bz2|xz|lzma|Z|zip|rar|7z)(-.)'" && return 0
|
|
@ -1,13 +0,0 @@
|
|||
#compdef unarchive
|
||||
#autoload
|
||||
|
||||
#
|
||||
# Completes unarchive.
|
||||
#
|
||||
# Authors:
|
||||
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
||||
#
|
||||
|
||||
_arguments \
|
||||
'(-r --remove)'{-r,--remove}'[remove archive]' \
|
||||
"*::archive file:_files -g '(#i)*.(tar|tgz|tbz|tbz2|txz|tlz|gz|bz2|xz|lzma|Z|zip|rar|7z|deb)(-.)'" && return 0
|
Loading…
Reference in a new issue