#!/usr/bin/env sh

# dirname "$0" will have a different result when called internaly by node.

DIR1=$( dirname "$0" )/../../node_modules/node-gyp/bin/node-gyp.js
DIR2=$( dirname "$0" )/../lib/node_modules/node-gyp/bin/node-gyp.js

if [ -e $DIR1 ]; then
	node "$DIR1" "$@" 
else
	if [ -e $DIR2 ]; then
		node "$DIR2" "$@" 
	else 
		echo "Can't find node-gyp.js!"
	fi
fi
