Abscissa / scriptlike

Utility library to help you write script-like programs in D
Other
93 stars 10 forks source link

Cross-platform way to run a program that's in the current directory. #32

Open Abscissa opened 7 years ago

Abscissa commented 7 years ago

./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`);
Bolpat commented 7 years ago

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.

Abscissa commented 7 years ago

Yes, that's one of the possibilities I've been considering. Just wanted to give it all some more thought.