I'm trying to minimize the amount of boilerplate that I have to write in an ammonite script. It seems like predef.sc is not loaded by default (which is good) but I'd like to have different sets of predefs for different files, and simply write a line to load them.
It seems like there's no way to refer to /
or $HOME
without importing ammonite-shell
(which in turn requires you to use import $ivy
/interp.load.ivy
which means at least 3-4 lines in total). Using relative paths ($file.^.somefolder.somefile
) works but relative paths break too easily.
So hence the question - is there a one-liner to load a script relative to root
or $HOME
? something like
$exec $file.`$HOME`.path.to.somefile