Files
armorpaint/Sources/arm/io/ImportPlugin.hx
T
2020-01-10 15:40:20 +01:00

21 lines
512 B
Haxe

package arm.io;
import arm.sys.Path;
import arm.sys.File;
class ImportPlugin {
public static function run(path: String) {
if (!Path.isPlugin(path)) {
Log.error(Strings.error1);
return;
}
var filename = path.substr(path.lastIndexOf(Path.sep) + 1);
var dstPath = Path.data() + Path.sep + "plugins" + Path.sep + filename;
File.copy(path, dstPath); // Copy to plugin folder
arm.ui.BoxPreferences.filesPlugin = null; // Refresh file list
Log.info("Plugin '" + filename + "' imported.");
}
}