As i could see, the Gjs imports
, loads only /usr/share/gjs-1.0
and /usr/lib/gjs-1.0
by default. I want to modularize an application, like we can do with node, but i must find modules relative to the script file.
I found this two ways to add include paths:
gjs --include-path=my-modules my-script.js
GJS_PATH=my-modules gjs my-script.js
...but both are related to the current directory, not to the file (obliviously), and they needed to be declared on the command line, making this unnecessarily complex.
How can i set a including path in the Gjs code? (So i can make this relative to the file)
Or... There is another way to import files from anywhere, like in python?
(Please, you don't need to propose to use a shellscript launcher to solve the --include-path
and GJS_PATH
problem. That is obvious, but less powerful. If we do not have a better solution, we survive with that.)
/@(.+?)(?::\d+){1,2}/
– Cleocleobulus