jordwalke / esy-issues

Easy ISSUES
MIT License
49 stars 5 forks source link

esy scriptName #66

Closed jordwalke closed 7 years ago

jordwalke commented 7 years ago

What do people think about the following feature:

esy scriptName

Could call the script named scriptName, stored in the "scripts" section of package.json. This would be similar to npm run scriptName, but it would construct an environment from esy (as if you were building that package using script name scriptName).

Yarn also has a similar feature - the only difference being that we would want to construct the environment according to esy's approach.

The way I think about "scripts", in this case, is that they are like named binaries placed in the path of esy commands executed in that sandbox. I imagine if for every script name, there was an executable by that same name created implicitly in the directory that you execute esy commands.

andreypopp commented 7 years ago

I think that the current esy CMD behaviour is a better building block for more complex workflows. It allows ad-hoc command execution easily while "named binaries" can be implemented by just placing a script which calls into esy with a given command:

#!/bin/bash
exec esy some-executable

That said I'm totally biased against npm scripts approach as I think managing code inside a JSON file is just plain wrong. I think current esy CMD is superior.

jordwalke commented 7 years ago

Okay, that's a good point, I'll try out your suggested approach for a while.

jordwalke commented 7 years ago

Sounds good.