Mercurial > MadButterfly
annotate nodejs/run.sh @ 939:a74b4d986a91
Move examples for nodejs into nodejs/examples/ sub-directories.
See INSTALL.txt. Use nodejs/examples/run.sh to run examples.
For example,
cd nodejs/examples; ./run.sh examples/testsvg/testsvg.js
author | Thinker K.F. Li <thinker@codemud.net> |
---|---|
date | Fri, 12 Nov 2010 17:39:04 +0800 |
parents | |
children | 652199a55802 |
rev | line source |
---|---|
939
a74b4d986a91
Move examples for nodejs into nodejs/examples/ sub-directories.
Thinker K.F. Li <thinker@codemud.net>
parents:
diff
changeset
|
1 #!/bin/sh |
a74b4d986a91
Move examples for nodejs into nodejs/examples/ sub-directories.
Thinker K.F. Li <thinker@codemud.net>
parents:
diff
changeset
|
2 |
a74b4d986a91
Move examples for nodejs into nodejs/examples/ sub-directories.
Thinker K.F. Li <thinker@codemud.net>
parents:
diff
changeset
|
3 ABS=`realpath $0` |
a74b4d986a91
Move examples for nodejs into nodejs/examples/ sub-directories.
Thinker K.F. Li <thinker@codemud.net>
parents:
diff
changeset
|
4 BASE=`dirname $ABS` |
a74b4d986a91
Move examples for nodejs into nodejs/examples/ sub-directories.
Thinker K.F. Li <thinker@codemud.net>
parents:
diff
changeset
|
5 NODE_PATH=$BASE:$NODE_PATH |
a74b4d986a91
Move examples for nodejs into nodejs/examples/ sub-directories.
Thinker K.F. Li <thinker@codemud.net>
parents:
diff
changeset
|
6 export NODE_PATH |
a74b4d986a91
Move examples for nodejs into nodejs/examples/ sub-directories.
Thinker K.F. Li <thinker@codemud.net>
parents:
diff
changeset
|
7 |
a74b4d986a91
Move examples for nodejs into nodejs/examples/ sub-directories.
Thinker K.F. Li <thinker@codemud.net>
parents:
diff
changeset
|
8 DIR=`dirname $1` |
a74b4d986a91
Move examples for nodejs into nodejs/examples/ sub-directories.
Thinker K.F. Li <thinker@codemud.net>
parents:
diff
changeset
|
9 FNAME=`basename $1` |
a74b4d986a91
Move examples for nodejs into nodejs/examples/ sub-directories.
Thinker K.F. Li <thinker@codemud.net>
parents:
diff
changeset
|
10 |
a74b4d986a91
Move examples for nodejs into nodejs/examples/ sub-directories.
Thinker K.F. Li <thinker@codemud.net>
parents:
diff
changeset
|
11 cd $DIR; node $FNAME |