Copy link to clipboard
Copied
How do you read environment vars? Was hoping it was as simple as process.env.ENV_VAR, but that does not work.
Also, when using project.save, and isBusy() is true, what is the best way to wait until Substance is not busy and then save? I am basically creating a project and then saving it. For now I am using a setTimeout to 5 seconds which does the job, but maybe I can temporarily listen for the busyStatusChanged event when isBusy is true?
thanks!!
Copy link to clipboard
Copied
With the Javascript API we don't provide a way to access the environement, so retireving the env-var of the process in which the application runs it not doable.
(You can however access that information via the Python API with the regular os module.)
Regarding saving in case the project is busy, a Timer is probably the best indeed. That's how the autosave plugin works if I recall properly. You can take a look at it for inspiration.
Copy link to clipboard
Copied
Thank you very much for confirming. This will be a good reason for us to move to python to match the rest the of the pipeline.