-
Notifications
You must be signed in to change notification settings - Fork 36
situate shell paths pattern
Tim L edited this page Mar 24, 2014
·
11 revisions
When installing shell-based tools, it can often be a pain to deal with getting the right paths and classpaths set for the tool to work properly. I've started using what I call the "situate path pattern" that is a script that you can call from anywhere that returns the path string to concatenate to your existing paths. If none are needed, then an empty string is returned (so , it's idempotent; feel free to do it as often as you need and your path won't get cluttered).
Scripts that apply the situate shell pattern (listed from oldest to newest):
PATH:
- https://github.com/timrdf/csv2rdf4lod-automation/blob/master/bin/util/cr-situate-paths.sh
- https://github.com/timrdf/DataFAQs/blob/master/bin/df-situate-paths.sh
- https://github.com/timrdf/prizms/blob/master/bin/install/paths.sh
CLASSPATH:
- https://github.com/timrdf/csv2rdf4lod-automation/blob/master/bin/util/cr-situate-classpaths.sh
- https://github.com/timrdf/plunk/blob/master/bin/pl-situate-classpath.sh
- https://github.com/timrdf/vsr/blob/master/bin/vsr-situate-classpaths.sh
- bte-situate-classpaths.sh
Example usage:
bash-3.2$ /Users/me/projects/plunk/bin/pl-situate-classpath.sh --help
pl-situate-classpath.sh [--help] [-v] [--export]
Put them there by executing:
export CLASSPATH=$CLASSPATH`/Users/me/projects/plunk/bin/pl-situate-classpath.sh`
bash-3.2$ /Users/me/projects/plunk/bin/pl-situate-classpath.sh
:/Users/me/projects/plunk/lib/csv2rdf4lod/openrdf-sesame-2.2.4-onejar.jar:/Users/me/projects/plunk/lib/csv2rdf4lod/slf4j-api-1.5.6.jar:/Users/me/projects/plunk/lib/csv2rdf4lod/slf4j-nop-1.5.6.jar:/Users/me/projects/plunk/lib/csv2rdf4lod.jar
bash-3.2$ export CLASSPATH=$CLASSPATH`/Users/me/projects/plunk/bin/pl-situate-classpath.sh`
<nothing returned; the CLASSPATH was updated>
bash-3.2$ /Users/me/projects/plunk/bin/pl-situate-classpath.sh
<nothing returned, since no new paths need to be added>