This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
CRUGG's profile picture

Global Programs / APIs

Started by CRUGG, 31 May 2019 - 07:38 AM
CRUGG #1
Posted 31 May 2019 - 09:38 AM
Hey there! Is it possible to globally install Programs and APIs from Code? I don't want to externally move the Code into the ROM Folder.
I know that you can set the program folder using

shell.setPath("/myPrograms/")
But this would not let me use the programs in /rom anymore and it would not let me be allowed to have seperate Folders for apis, programs etc.
I think the easiest way would be to just have a complete clone of the folder Structure of Rom somewhere and have both active, if that is possible.
Lupus590 #2
Posted 31 May 2019 - 12:33 PM
Get the path first and then set the new path to be the old path and your new path.

The wiki for the setpath function might explain it better than me at the moment
EveryOS #3
Posted 31 May 2019 - 03:30 PM

shell.setPath(shell.path()..";myPrograms/;")
Luca_S #4
Posted 02 June 2019 - 05:48 AM

shell.setPath(shell.path()..";myPrograms/;")

According to the wiki the separator is ":", the path should be absolute and the trailing slash can be removed(I would suggest doing so to keep to the style of the existing path). Also the existing path does not end with a column, so neither should the new one:

shell.setPath(shell.path()..":/myPrograms")