WIP - Remove ShellJS gir
You can define a new importer object by importing a subdirectory in GJS. This is undocumented, but it is likely to at least hold until the whole thing moves to ES6 modules.
This commit is contained in:
@@ -6,9 +6,7 @@
|
||||
const Lang = imports.lang;
|
||||
const Signals = imports.signals;
|
||||
|
||||
const GLib = imports.gi.GLib;
|
||||
const Gio = imports.gi.Gio;
|
||||
const ShellJS = imports.gi.ShellJS;
|
||||
|
||||
const Config = imports.misc.config;
|
||||
const FileUtils = imports.misc.fileUtils;
|
||||
@@ -140,12 +138,11 @@ function createExtensionObject(uuid, dir, type) {
|
||||
return extension;
|
||||
}
|
||||
|
||||
var _extension = null;
|
||||
|
||||
function installImporter(extension) {
|
||||
_extension = extension;
|
||||
ShellJS.add_extension_importer('imports.misc.extensionUtils._extension', 'imports', extension.path);
|
||||
_extension = null;
|
||||
let oldSearchPath = imports.searchPath.slice(); // make a copy
|
||||
imports.searchPath = [extension.path];
|
||||
extension.imports = imports['.']; // "subdir" creates a new importer object
|
||||
imports.searchPath = oldSearchPath;
|
||||
}
|
||||
|
||||
const ExtensionFinder = new Lang.Class({
|
||||
|
Reference in New Issue
Block a user