
bsh.commands.sourceRelative.bsh Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bsh-console Show documentation
Show all versions of bsh-console Show documentation
A BeanShell console with history, autocompletion and more...
The newest version!
/**
Source a file relative to the callering script's directory.
e.g. scripts A running in dir A sources script B in dir B.
Script B can use this command to load additional scripts (data, etc.)
relative to its own location (dir B) without having to explicitly know
its "home" directory (B).
Note: this only works for files currently.
@since bsh1.3
@see source( file | URL );
*/
sourceRelative( String file )
{
this.dir = dirname(getSourceInfo());
this.path = pathToFile( dir + File.separator + file ).getAbsoluteFile();
return (new bsh.Utils()).source(this.interpreter, path, this.caller.namespace );
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy