diff options
author | Brian Picciano <bgp2396@bellsouth.net> | 2013-07-11 21:27:58 -0400 |
---|---|---|
committer | Brian Picciano <bgp2396@bellsouth.net> | 2013-07-11 21:27:58 -0400 |
commit | 6d80ce514e3b2ec096d713ab6e448caa25c22dbf (patch) | |
tree | cd3817da537d5805fb82a614d777fa6fdf53577b /res | |
parent | a4e2f98c269ca7bd090eed21aece8e74625ca612 (diff) |
go+
Diffstat (limited to 'res')
-rwxr-xr-x | res/go+ | 27 |
1 files changed, 27 insertions, 0 deletions
@@ -0,0 +1,27 @@ +#!/bin/sh + +SEARCHING_FOR=GOPROJROOT +ORIG_DIR=$(pwd) + +STOPSEARCH=0 +SEARCH_DIR=$ORIG_DIR +while [ $STOPSEARCH = 0 ]; do + + RES=$( find $SEARCH_DIR -maxdepth 1 -type f -name $SEARCHING_FOR | \ + grep -P "$SEARCHING_FOR$" | \ + head -n1 ) + + if [ "$RES" = "" ]; then + if [ "$SEARCH_DIR" = "/" ]; then + STOPSEARCH=1 + fi + cd .. + SEARCH_DIR=$(pwd) + else + export GOPATH=$SEARCH_DIR:$GOPATH + STOPSEARCH=1 + fi +done + +cd "$ORIG_DIR" +exec go $@ |