Permalink
Browse files

added mime as top-level dep. githook.sh will now run properly from an…

…y directory
  • Loading branch information...
coolaj86 committed Nov 1, 2011
1 parent 248fad4 commit 9b4653ff73654050387fd4d45fd135e0ec1549b6
Showing with 16 additions and 4 deletions.
  1. +4 −0 README.md
  2. +10 −3 githook.sh
  3. +2 −1 package.json
View
@@ -161,6 +161,10 @@ By default, these commands will be run:
**per-vhost githook.sh** - `~/webapps/vhosts/foobar3000.com/githook.sh` - include any commands here that should be run **instead of** the primary **~/webapps/githook.sh**.
+Notes
+===
+
+ * `mime` is listed as a top-level dependency of vhoster to allow you to extend `connect`s mimetypes
Warning
===
View
@@ -1,6 +1,8 @@
#!/bin/bash
-
-VHOST_DIR="/var/webapps/vhosts"
+# THISDIR will refer to the path to this script
+# see http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in
+THISDIR="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+VHOST_DIR="${THISDIR}/vhosts"
LS="/bin/ls"
VHOSTS=$(${LS} ${VHOST_DIR})
HOOK_SCRIPT="githook.sh"
@@ -22,7 +24,12 @@ do
elif [ -d "${SERVICE}/.git" ]; then
cd ${SERVICE}
${GIT} fetch
- ${GIT} checkout master
+ if [ -f "BRANCH" ]; then
+ BRANCH=`cat BRANCH`
+ else
+ BRANCH="master"
+ fi
+ ${GIT} checkout ${BRANCH} 2>&1 2>/dev/null || true
${GIT} pull
${GIT} submodule init
${GIT} submodule update
View
@@ -2,7 +2,7 @@
"author": "AJ ONeal <coolaj86@gmail.com> (http://coolaj86.info)",
"name": "connect-vhoster",
"description": "Throw your Node.JS apps in /var/webapps/vhosts and let 'er rip!",
- "version": "1.1.0",
+ "version": "1.1.1",
"repository": {
"type": "git",
"url": "git://github.com/coolaj86/connect-vhoster.git"
@@ -14,6 +14,7 @@
"connect": "~v1.0.0"
, "nowww": "~v1.1.0"
, "github-hook": "~v1.0.0"
+ , "mime": "~v1.2"
},
"devDependencies": {}
}

0 comments on commit 9b4653f

Please sign in to comment.