import_plugin.ts 471 B

12345678910111213
  1. function import_plugin_run(path: string) {
  2. if (!path_is_plugin(path)) {
  3. console_error(strings_error1());
  4. return;
  5. }
  6. let filename: string = substring(path, string_last_index_of(path, path_sep) + 1, path.length);
  7. let dst_path: string = path_data() + path_sep + "plugins" + path_sep + filename;
  8. file_copy(path, dst_path); // Copy to plugin folder
  9. box_preferences_files_plugin = null; // Refresh file list
  10. console_info(tr("Plugin imported:") + " " + filename);
  11. }