Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F6241333
plugin-manager.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1015 B
Referenced Files
None
Subscribers
None
plugin-manager.js
View Options
var
Sealious
=
require
(
"../main.js"
);
var
path
=
require
(
"path"
);
var
PluginManager
=
new
function
()
{
function
load_plugins_from_dir
(
dir
)
{
dir
=
dir
||
""
;
var
root
=
path
.
resolve
(
dir
);
var
pkgfile
=
path
.
join
(
root
,
'package.json'
);
var
pkg
=
require
(
pkgfile
);
for
(
var
dependency_name
in
pkg
.
dependencies
)
{
var
plugin_package_info_file
=
path
.
resolve
(
root
,
"node_modules"
,
dependency_name
,
"package.json"
);
var
plugin_package_info
=
require
(
plugin_package_info_file
);
if
(
plugin_package_info
.
keywords
&&
plugin_package_info
.
keywords
.
indexOf
(
"sealious-plugin"
)
!==
-
1
)
{
Sealious
.
Logger
.
info
(
"Detected plugin "
+
plugin_package_info
.
name
);
var
plugin
=
require
(
path
.
resolve
(
root
,
"node_modules"
,
dependency_name
));
}
}
}
this
.
load_plugins
=
function
()
{
load_plugins_from_dir
(
""
);
var
sealious_dir
=
path
.
resolve
(
module
.
filename
,
"../../../"
);
if
(
sealious_dir
!=
path
.
resolve
(
""
))
{
load_plugins_from_dir
(
sealious_dir
);
}
}
}
module
.
exports
=
PluginManager
;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Jun 17, 03:29 (1 d, 10 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
757270
Default Alt Text
plugin-manager.js (1015 B)
Attached To
Mode
rS Sealious
Attached
Detach File
Event Timeline
Log In to Comment