From f8a7d118080805a42ca4c2ef65a69d6da1e1536e Mon Sep 17 00:00:00 2001 From: brc Date: Mon, 13 Aug 2012 18:07:28 -0700 Subject: [PATCH 1/3] Adding extensionless script to Shell samples --- samples/Shell/script_noext | 55 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 samples/Shell/script_noext diff --git a/samples/Shell/script_noext b/samples/Shell/script_noext new file mode 100644 index 00000000..cc12216b --- /dev/null +++ b/samples/Shell/script_noext @@ -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" From 897f39083dd83be2e8c57b0ea164a40e5e1d5437 Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Mon, 13 Aug 2012 18:17:44 -0700 Subject: [PATCH 2/3] Rename to magic .script! ext --- samples/Shell/{script_noext => plugin.script!} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename samples/Shell/{script_noext => plugin.script!} (100%) diff --git a/samples/Shell/script_noext b/samples/Shell/plugin.script! similarity index 100% rename from samples/Shell/script_noext rename to samples/Shell/plugin.script! From 866e446dbe0d8b893de76ac5b73cc3cfd613cc0b Mon Sep 17 00:00:00 2001 From: Joshua Peek Date: Mon, 13 Aug 2012 18:17:47 -0700 Subject: [PATCH 3/3] Rebuild samples db --- lib/linguist/samples.json | 135 +++++++++++++++++++++++++++++--------- 1 file changed, 104 insertions(+), 31 deletions(-) diff --git a/lib/linguist/samples.json b/lib/linguist/samples.json index c7088cc3..311cc0f5 100644 --- a/lib/linguist/samples.json +++ b/lib/linguist/samples.json @@ -257,8 +257,8 @@ ".gemrc" ] }, - "tokens_total": 333026, - "languages_total": 260, + "tokens_total": 333210, + "languages_total": 261, "tokens": { "Apex": { "/*": 15, @@ -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, @@ -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, @@ -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, @@ -24658,7 +24738,6 @@ "version": 1, "z": 3, "&": 4, - "exit": 6, "prefix": 1, "/dev/null": 2, "rvm_ignore_rvmrc": 1, @@ -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, @@ -26710,7 +26783,7 @@ "Scheme": 3484, "Scilab": 72, "SCSS": 39, - "Shell": 314, + "Shell": 498, "Standard ML": 247, "SuperCollider": 141, "Tea": 3, @@ -26780,7 +26853,7 @@ "Scheme": 1, "Scilab": 3, "SCSS": 1, - "Shell": 14, + "Shell": 15, "Standard ML": 2, "SuperCollider": 1, "Tea": 1, @@ -26795,5 +26868,5 @@ "XSLT": 1, "YAML": 1 }, - "md5": "e5daa0ff6e34a82348f754c1584d0040" + "md5": "4e15c989e08fea5b847096e54a7a5eb4" } \ No newline at end of file