Skip to content

Commit

Permalink
Merge branch 'brcooley-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
josh committed Aug 14, 2012
2 parents ed70d29 + 866e446 commit 080cd09
Show file tree
Hide file tree
Showing 2 changed files with 159 additions and 31 deletions.
135 changes: 104 additions & 31 deletions lib/linguist/samples.json
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,8 @@
".gemrc"
]
},
"tokens_total": 333026,
"languages_total": 260,
"tokens_total": 333210,
"languages_total": 261,
"tokens": {
"Apex": {
"/*": 15,
Expand Down Expand Up @@ -24587,23 +24587,23 @@
"/": 2
},
"Shell": {
"SHEBANG#!bash": 4,
"echo": 14,
"SHEBANG#!bash": 5,
"echo": 19,
"export": 6,
"PATH": 5,
"#": 5,
"#": 15,
"pkgname": 1,
"stud": 4,
"-": 23,
"git": 5,
"-": 41,
"git": 9,
"pkgver": 1,
"pkgrel": 1,
"pkgdesc": 1,
"arch": 1,
"(": 14,
"(": 16,
"i686": 1,
"x86_64": 1,
")": 14,
")": 19,
"url": 1,
"license": 1,
"depends": 1,
Expand All @@ -24617,25 +24617,25 @@
"//github.com/bumptech/stud.git": 1,
"_gitname": 1,
"build": 1,
"{": 4,
"{": 5,
"cd": 4,
"msg": 4,
"if": 12,
"[": 21,
"if": 15,
"[": 24,
"d": 4,
"]": 21,
";": 6,
"then": 14,
"]": 24,
";": 16,
"then": 17,
"&&": 4,
"pull": 1,
"pull": 3,
"origin": 1,
"else": 5,
"else": 6,
"clone": 2,
"fi": 12,
"rm": 1,
"fi": 15,
"rm": 2,
"rf": 1,
"make": 2,
"}": 4,
"}": 5,
"package": 1,
"PREFIX": 1,
"/usr": 1,
Expand All @@ -24645,8 +24645,88 @@
"init.stud": 1,
"mkdir": 1,
"p": 1,
"Bash": 1,
"script": 1,
"to": 4,
"the": 3,
"dotfile": 1,
"repository": 2,
"does": 1,
"a": 2,
"lot": 1,
"of": 1,
"fun": 2,
"stuff": 2,
"like": 1,
"turning": 1,
"normal": 1,
"dotfiles": 1,
"eg": 1,
".bashrc": 1,
"into": 1,
"symlinks": 1,
"this": 1,
"away": 1,
"optionally": 1,
"moving": 1,
"old": 1,
"files": 1,
"so": 1,
"that": 1,
"they": 1,
"can": 1,
"be": 1,
"preserved": 1,
"setting": 1,
"up": 1,
"cron": 1,
"job": 1,
"automate": 1,
"aforementioned": 1,
"and": 1,
"maybe": 1,
"some": 1,
"more": 1,
"shopt": 1,
"s": 2,
"nocasematch": 1,
"POSTFIX": 1,
"URL": 1,
"PUSHURL": 1,
"overwrite": 3,
"true": 1,
"print_help": 2,
"e": 2,
"exit": 7,
"for": 3,
"opt": 2,
"in": 4,
"@": 1,
"do": 3,
"case": 1,
"k": 1,
"|": 2,
"keep": 1,
"local": 3,
"false": 2,
"h": 1,
"help": 1,
"esac": 1,
"done": 3,
"f": 3,
".*": 1,
"o": 3,
"continue": 1,
"mv": 1,
"ln": 1,
"config": 2,
"remote.origin.url": 1,
"remote.origin.pushurl": 1,
"crontab": 1,
".jobs.cron": 1,
"source": 3,
"/.bashrc": 1,
"set": 2,
"e": 1,
"n": 2,
"x": 1,
"unset": 3,
Expand All @@ -24658,7 +24738,6 @@
"version": 1,
"z": 3,
"&": 4,
"exit": 6,
"prefix": 1,
"/dev/null": 2,
"rvm_ignore_rvmrc": 1,
Expand All @@ -24667,15 +24746,9 @@
"rvm_rvmrc_files": 3,
"ef": 1,
"+": 1,
"for": 1,
"in": 1,
"do": 1,
"f": 1,
"GREP_OPTIONS": 1,
"grep": 1,
"printf": 1,
"source": 2,
"done": 1,
"rvm_path": 4,
"UID": 1,
"elif": 2,
Expand Down Expand Up @@ -26710,7 +26783,7 @@
"Scheme": 3484,
"Scilab": 72,
"SCSS": 39,
"Shell": 314,
"Shell": 498,
"Standard ML": 247,
"SuperCollider": 141,
"Tea": 3,
Expand Down Expand Up @@ -26780,7 +26853,7 @@
"Scheme": 1,
"Scilab": 3,
"SCSS": 1,
"Shell": 14,
"Shell": 15,
"Standard ML": 2,
"SuperCollider": 1,
"Tea": 1,
Expand All @@ -26795,5 +26868,5 @@
"XSLT": 1,
"YAML": 1
},
"md5": "e5daa0ff6e34a82348f754c1584d0040"
"md5": "4e15c989e08fea5b847096e54a7a5eb4"
}
55 changes: 55 additions & 0 deletions samples/Shell/plugin.script!
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/bin/bash
#
# Bash script to "plugin" to the dotfile repository, does a lot of fun stuff
# like turning the normal dotfiles (eg .bashrc) into symlinks to this
# repository's versions of those files (ensure that updates are just a
# 'git pull' away), optionally moving old files so that they can be
# preserved, setting up a cron job to automate the aforementioned git
# pull, and maybe some more fun stuff
#

shopt -s nocasematch # This makes pattern matching case-insensitive

POSTFIX="local"
URL="https://github.com/brcooley/.f.git"
PUSHURL="git@github.com:brcooley/.f.git"

overwrite=true

print_help () {
echo -e "\nA script to keep dotfiles up to date\n"
echo "Options:"
echo " -k, --keep-local Keeps local copies of dotfiles by appending"
echo " \"$POSTFIX\" to them"
exit 0
}


for opt in $@; do
case $opt in
-k | --keep-local) overwrite=false;;
-h | --help) print_help;;
esac
done



for f in .*; do
if [ "$f" = ".git" -o "$f" = "." -o "$f" = ".." -o "$f" = ".f" ]; then continue; fi
if [ -f "$HOME/$f" ]; then
if [ $overwrite = false ]; then
mv "$HOME/$f" "$HOME/${f}_$POSTFIX"
else
rm "$HOME/$f"
fi
# echo "Moving ~/$f to $HOME/${f}_$POSTFIX"
fi
ln -s "$PWD/$f" "$HOME/$f"
done

# Git versions prior to 1.7.? (1.7.1 confirmed) do not have a --local option
git config --local remote.origin.url "$URL"
git config --local remote.origin.pushurl "$PUSHURL"
crontab .jobs.cron
source ~/.bashrc
echo "Plugin succesful"

0 comments on commit 080cd09

Please sign in to comment.