main: Pass script on CLI instead of via environment
Environment variables aren't the best option to pass parameters to a process (wouldn't it be "fun" if SHELL_PERF_MODULE appeared in a regular user session?). Instead, use a (hidden) --automation-script command line flag to specify a script file that should be used to drive an automated session. As a side effect, the script no longer has to be relative to the main module itself, so it will be possible to run scripts that aren't bundled with the shell sources. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2812>
This commit is contained in:
@ -326,9 +326,9 @@ async function _initializeUI() {
|
||||
}
|
||||
|
||||
let perfModule;
|
||||
const perfModuleName = GLib.getenv('SHELL_PERF_MODULE');
|
||||
if (perfModuleName) {
|
||||
perfModule = await import(`../perf/${perfModuleName}.js`);
|
||||
const {automationScript} = global;
|
||||
if (automationScript) {
|
||||
perfModule = await import(automationScript.get_uri());
|
||||
if (perfModule.init)
|
||||
perfModule.init();
|
||||
}
|
||||
|
Reference in New Issue
Block a user