You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it possible to write all scripts in one file? I'm loving the idea of getting my scripts separated from the package.json config, having syntax highlighting and not having to quote-escape them, but I'm afraid that having all my scripts in separated files will make it too separated and hard to maintain.
Could I for example write a scripts/index file, like a explicit parent script, that also receives the script path that is being executed? Then I could write a switch statement to handle all scripts.
The text was updated successfully, but these errors were encountered:
Thanks for opening the issue, but unfortunately I wouldn't support the inclusion of this feature. For what it's worth, writing your own module to accomplish this wouldn't be a tremendous task, I don't think. My reasoning follows:
I firmly believe that in file-system based code organization schemes (which is to say, nearly all of them), small, focused, and well-named files offer numerous substantive advantages over the apparent comfort of navigating one huge file that serves numerous purposes. The goal of scripty is to give users a low-friction way to extract scripts once they've gotten too long or too numerous to be easy-to-comprehend and maintain in a package.json.
It's for those reasons that a feature like the one proposed here wouldn't serve the goal of the package. It might salve some of the string-escape/newline pain you described, but it'd also introduce a layer of indirection. Additionally, for people otherwise familiar with scripty, it would produce surprising behavior when it was used ("where does this script live?"), requiring them to debug configuration and so forth to make sense of it. As it stands, it's pretty easy to see where a script is by looking at the file system, and this module should probably stay that way.
Is it possible to write all scripts in one file? I'm loving the idea of getting my scripts separated from the package.json config, having syntax highlighting and not having to quote-escape them, but I'm afraid that having all my scripts in separated files will make it too separated and hard to maintain.
Could I for example write a
scripts/index
file, like a explicit parent script, that also receives the script path that is being executed? Then I could write a switch statement to handle all scripts.The text was updated successfully, but these errors were encountered: