scriptlike
scriptlike copied to clipboard
Cross-platform way to run a program that's in the current directory.
./somebin ...
works everywhere but windows. Omitting the ./
only works on windows. Need to figure out a good way so scripts don't need awful garbage like:
run(`.`~dirSeparator~`mytool --args`);
or
run(buildPath(`.`, `mytool`)~` --args`);
or
version(Windows)
run(`mytool --args`);
else
run(`./mytool --args`);
What about a function that does it for you? Or implement it in run
itself, i.e. on Windows, run(`./mytools --args`)
becomes run(`mytool --args`)
? That's pretty simple and does the job.
Yes, that's one of the possibilities I've been considering. Just wanted to give it all some more thought.