Errors in shell_adv()
LadyCailinBot opened this issue ยท 2 comments
CMDHELPER-2803 - Reported by RobotoRaccoon
Many issues with locating files within directories. These all worked fine in commandline outside of Minecraft.
Was told to submit this in IRC, so apologies for lack of important details, if any.
IOException: Cannot run program "./printSchematics.sh": error=2, No such file or directory
<
shell_adv('./printSchematics.sh')
ShellException: find: >': No such file or directory find:
/home/steam/minecraft/SharedServerFiles/Schematics/deliciousfiles.txt': No such file or directory
shell_adv('find . > /home/steam/minecraft/SharedServerFiles/Schematics/deliciousfiles.txt')
And so on in that fashion for attempts like:
shell_adv('ls -1 * >dump.txt')
Comment by LadyCailin
Pipes and things won't work. Those operators are provided by things like bash or the windows terminal, but not the shell() functions. I have no plans on adding that support any time soon either. Instead, you can do something like this (if you're on linux): shell('bash -c "echo hi > test.txt"') which will cause CH to invoke bash, which will in turn execute the given bash script (which does support pipes and other things).
As to your first example, bash has special support for the way ./ works, I will add such support as well, and that will fix the first example, anyways.
Comment by LadyCailin
Ok, after thinking about it some more, I would like to add full support for path expansion, so ./ and ~ should work, however, this will require more research and time, so this feature will be put on the backburner. In the meantime, you can list out the full path to the executable, and that will work, or just always use the bash command to run the commands via bash interpretation. At this point, shell() is still pretty primitive. For instance: shell('bash printSchematics.sh')