Skip to content

Instantly share code, notes, and snippets.

@Sketches-su
Last active August 29, 2015 14:14
Show Gist options
  • Select an option

  • Save Sketches-su/29e2220f693c2ff37cfe to your computer and use it in GitHub Desktop.

Select an option

Save Sketches-su/29e2220f693c2ff37cfe to your computer and use it in GitHub Desktop.

Revisions

  1. Sketches-su revised this gist Feb 4, 2015. 1 changed file with 0 additions and 0 deletions.
    Empty file modified plz
    100644 → 100755
    Empty file.
  2. Sketches-su created this gist Feb 4, 2015.
    36 changes: 36 additions & 0 deletions plz
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,36 @@
    #!/bin/bash

    # A set of console shortcuts. Save it to ~/bin/plz and chmod a+x ~/bin/plz

    case "$1" in
    "gi") # Add empty .gitignore to current dir
    [ -f .gitignore ] || touch .gitignore
    ;;
    "ht") # Add restricting .htaccess to current dir
    [ -f .htaccess ] || echo -e "Order Allow,Deny\nDeny From All" > .htaccess
    ;;
    ".git") # Init non-bare GIT repo in current dir
    if [ ! -d .git ]; then
    git init
    git config user.name Sketches
    git config user.email [email protected]
    echo "/cgi-bin" >> .git/info/exclude
    echo "/nbproject" >> .git/info/exclude

    if [ ! -f .gitignore ]; then
    touch .gitignore

    if [ -d vendor ]; then
    echo "/vendor" >> .gitignore
    fi

    echo "!.gitignore" >> .gitignore
    echo "!.htaccess" >> .gitignore
    fi
    fi
    ;;
    *)
    echo "Error!"
    sleep 3
    ;;
    esac