diff options
author | tv <tv@nomic.retiolum> | 2013-12-30 14:47:53 +0100 |
---|---|---|
committer | tv <tv@nomic.retiolum> | 2013-12-30 14:47:53 +0100 |
commit | 2924760337fa6f5ecc64df99f4e022b0b7965c4f (patch) | |
tree | d1158b010d3668a3681274bde494ae8e82ce5c8e /query | |
parent | db8fd88a4f8bd4e82b4977ceb9d033b44cfcf13c (diff) | |
parent | 08aa5e406a1f7b39182e79ea4eb7fabf7d61eaa3 (diff) |
Merge branch 'master' of https://github.com/krebscode/painload
Diffstat (limited to 'query')
-rwxr-xr-x | query/jquery/index | 19 | ||||
-rwxr-xr-x | query/realpath/install | 41 | ||||
-rwxr-xr-x | query/realpath/src/realpath.rb | 10 |
3 files changed, 70 insertions, 0 deletions
diff --git a/query/jquery/index b/query/jquery/index new file mode 100755 index 00000000..3c49dac9 --- /dev/null +++ b/query/jquery/index @@ -0,0 +1,19 @@ +#! /bin/sh +set -euf + +# cd // +cd $(dirname $(readlink -f $0))/../.. + +for x in \ + github/tmpvar \ + github/mikeal \ + github/NV \ + github/tautologistics \ +; do + export NODE_PATH="$(readlink -f submodules/$x)${NODE_PATH+:$NODE_PATH}" +done + +# ensure query is ready +#git submodule update --init + +exec node submodules/github/visionmedia/query "$@" diff --git a/query/realpath/install b/query/realpath/install new file mode 100755 index 00000000..74671c81 --- /dev/null +++ b/query/realpath/install @@ -0,0 +1,41 @@ +#! /bin/sh +set -euf + +cd `dirname $0` + +target=../../bin/realpath + +findexe() { + OLDIFS="$IFS" + IFS=: + for d in $PATH; do + f="$d/$1" + if test -f "$f" -a -x "$f"; then + echo $f + IFS="$OLDIFS" + return + fi + done + IFS="$OLDIFS" + ! : +} + +if exe="`findexe readlink`" && $exe -f install | grep -q /install$; then + ! test -e $target || rm $target + cat > $target <<EOF +#! /bin/sh -euf +exec $exe -f "\${1-\$file_name}" +EOF + chmod +x $target + echo '//query/realpath: install readlink' >&2 + exit +fi + +if type ruby 1>/dev/null 2>/dev/null; then + ln -snf ../query/realpath/src/realpath.rb $target + echo '//query/realpath: install realpath.rb' >&2 + exit +fi + +echo 'Error 2: your system is made of stupid!' +exit 23 diff --git a/query/realpath/src/realpath.rb b/query/realpath/src/realpath.rb new file mode 100755 index 00000000..8e19785b --- /dev/null +++ b/query/realpath/src/realpath.rb @@ -0,0 +1,10 @@ +#!/usr/bin/env ruby + +begin + $stdout.print File.realpath(ARGV[0]) + $stdout.print "\n" +rescue Exception => err + $stderr.print err + $stderr.print "\n" + exit 1 +end |