2023-02-08 14:51:54 +01:00
|
|
|
|
|
|
|
|
class ImportPlugin {
|
|
|
|
|
|
2024-01-17 18:53:31 +01:00
|
|
|
static run = (path: string) => {
|
2023-02-08 14:51:54 +01:00
|
|
|
if (!Path.isPlugin(path)) {
|
|
|
|
|
Console.error(Strings.error1());
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2024-01-17 18:53:31 +01:00
|
|
|
let filename = path.substr(path.lastIndexOf(Path.sep) + 1);
|
|
|
|
|
let dstPath = Path.data() + Path.sep + "plugins" + Path.sep + filename;
|
2023-02-08 14:51:54 +01:00
|
|
|
File.copy(path, dstPath); // Copy to plugin folder
|
2023-12-13 15:52:41 +01:00
|
|
|
BoxPreferences.filesPlugin = null; // Refresh file list
|
2023-02-08 14:51:54 +01:00
|
|
|
Console.info(tr("Plugin imported:") + " " + filename);
|
|
|
|
|
}
|
|
|
|
|
}
|