Open Emasoft opened 1 year ago
From the error, it looks like PyExecJS is looking for an executable to run JavaScript files. I certainly has some options, which it tried in _find_available_runtime()
, but unfortunately these options do not include the a-Shell command (jsc
). The other function on the same line (get_from_environment()
) is probably our solution. It seems that you can tell PyExecJS what the JavaScript Runtime is called using environment variables. I'm going to have a look at their documentation.
It's not going to be that easy: PyExecJS has a list of existing runtimes that it supports, indexed by names. Probably the closest is Apple JavaScriptCore, so you will need:
setenv EXECJS_RUNTIME JavaScriptCore
to tell it to use this runtime. But you will also need to edit PyExecJS/execjs/_external_runtime.py
, because it contains the location of the command, hardcoded as /System/Library/Frameworks/JavaScriptCore.framework/Versions/A/Resources/jsc
, which doesn't exist on iOS. Replacing that string by jsc
should work.
It seems tricky. Can you include a modified custom version of PyExecJS in the next version of a-Shell?
I have some issue with the PyExecJS library.