Is there a standard way in a unixesque (sh/bash/zsh) system to execute a group of scripts as if the group of scripts was one script? (Think index.html). The point is to avoid additional helper scripts like you usually find and keep small programs self sufficient and easier to maintain.
Say I have two (in bold) ruby scripts.
/bin
/bin/foo_master
/bin/foo_master/main
/bin/foo_master/helper.rb
So now when I execute foo_master
seo@macbook ~ $foo_master
[/bin/foo_master/main]: Make new friends, but keep the old.
[/bin/foo_master/helper.rb]: One is silver and the other gold.
I figured out how to do this in a semi-standard complaint fashion.
I used the eval syntax in shell scripting to lambda evaluate the $PATH at runtime. So in my /etc/.zshrc
$REALPATH = $PATH
$PATH = $REALPATH:`find_paths`
where find_paths is a function that recursively searches the $PATH directories for folders (pseudocode below)
(foreach path in $PATH => ls -d -- */)
So we go from this:
seo@macbook $ echo $PATH
/bin/:/usr/bin/
To this, automagically:
seo@macbook $ echo $PATH
/bin/:/usr/bin/:/bin/foo_master/
Now I just rename main to "foo_master" and voilà! Self contained executable, dare I say "app".