-
-
Save blinry/fc64b3a109dc7bd088470791d08768b1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cd $HOME/permanent/wiki | |
lastcommittime=$(git show --format="%ct" -s) | |
nowtime=$(date +%s) | |
if [ $(($nowtime - $lastcommittime)) -gt $((60*60*24)) ]; then | |
echo "Autocommit" | |
git add -A | |
git commit -m "Autocommit" | |
fi | |
cmd=$1 | |
shift | |
case $cmd in | |
e|edit) | |
if [ "$*" ]; then | |
"$EDITOR" "$*" | |
else | |
"$EDITOR" Startseite | |
fi | |
;; | |
s|search) | |
$0 t $* | |
echo | |
$0 f $* | |
;; | |
b|backlinks) | |
$0 f \\[$*\\] | |
;; | |
t|title) | |
ls | grep --color=auto -i "$*" | |
;; | |
f|fulltext) | |
egrep --color=auto -in "$*" * | |
;; | |
o|orphans) | |
for word in *; do | |
if [ -z "`$0 b $word`" ]; then | |
echo $word | |
fi | |
done | |
;; | |
r|random) | |
$0 e "$(ls | sort -R | head -1)" | |
;; | |
*) | |
$0 e $cmd $* | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment