CC: Tweaked

CC: Tweaked

42M Downloads

.bat equivalent

RuboGubo opened this issue ยท 4 comments

commented

Useful information to include:

  • Explanation of how the feature/change should work.
  • Some rationale/use case for a feature. My general approach to designing new features is to ask yourself "what issue are we trying to solve" and then "is this the best way to solve this issue?".

the .bat file in essence would run commands in the terminal when the file is executed
A use case could be to run a piece of code on startup on the monitor without having to go into the original code and changing it to use a monitor.

commented

I don't know if this is fully necessary, since all the commands that can be typed in the shell are "shortcuts" that runs programs containing Lua code.
tl; dr : Every shell command can be replicated with Lua code, is that feature necessary ?

commented

And if someone really wanted to execute shell commands they could just write lua code that contains few shell.runs in row:

shell.run("rm something.lua")
shell.rum("dj right")
shell.run("id")

And get same effect as .bat file.

commented

How would the code that runs the supposed .bat files be ?
The only way I could think of is :

  • Read the file,
  • For each line, run shell.run(that_line).
  • Done.

I personally think this is as simple to write it yourself, and not worth implementing right now. Fully agreeing with @Wojbie, you could chain shell.run calls to get the effect you want.

commented

As other's have mentioned, I'm not sure there's much point with this. CC's shell-scripting capabilities are pretty non-existent (no redirects/pipes, variables, any form of structure), and anything more complex is probably better served by Lua scripts.