diff --git a/package.json b/package.json index eb6a34e..ccf3648 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@levimc-lse/scaffold", - "version": "0.2.1", + "version": "0.2.2", "description": "A utility for assisting in the development of Legacy Script Engine plugins.", "bugs": "https://github.com/leoweyr/LegacyScriptEngine_Scaffold/issues", "bin": { diff --git a/src/cli/index.ts b/src/cli/index.ts index bb2ecf5..63e1e2f 100644 --- a/src/cli/index.ts +++ b/src/cli/index.ts @@ -59,16 +59,16 @@ program try { const project: TypeScriptProject = TypeScriptProject.getInstance(); const packager: Packager = new Packager(project); - const levilaminaServer: LevilaminaServer = new LevilaminaServer(path); + const leviLaminaServer: LevilaminaServer = new LevilaminaServer(path); const pluginPackage: PluginPackage = packager.getPluginPackage(); try { - levilaminaServer.removePlugin(project.getName()); + leviLaminaServer.removePlugin(project.getName()); } catch (error) { // Do nothing if the plugin does not exist. } - const successMessage: string = await levilaminaServer.importPlugin(pluginPackage); + const successMessage: string = await leviLaminaServer.importPlugin(pluginPackage); logger.success(successMessage); } catch (error) { diff --git a/src/deployment/LevilaminaServer.ts b/src/deployment/LevilaminaServer.ts index 3b1acc1..6062671 100644 --- a/src/deployment/LevilaminaServer.ts +++ b/src/deployment/LevilaminaServer.ts @@ -29,7 +29,7 @@ export class LevilaminaServer { } public removePlugin(pluginName: string): void { - const pluginPath: string = Path.join(this.pluginDirectory, pluginName); + const pluginPath: string = Path.join(this.pluginDirectory, pluginName.replace("/", "-").replace("@","")); if (File.existsSync(pluginPath)) { LevilaminaServer.deleteDirectory(pluginPath); diff --git a/src/packager/Manifest.ts b/src/packager/Manifest.ts index 57a3b14..d478c9e 100644 --- a/src/packager/Manifest.ts +++ b/src/packager/Manifest.ts @@ -36,7 +36,7 @@ export class Manifest { public generate(): string { const nodeJsConfiguration: NodeJsConfiguration = this.project.getNodeJsConfiguration(); - const name: string = nodeJsConfiguration.getName(); + const name: string = nodeJsConfiguration.getName().replace("/", "-").replace("@", ""); const version: string = nodeJsConfiguration.getVersion(); const absoluteEntry: string = Path.join(this.project.getPath(), nodeJsConfiguration.getMainEntry()); const relativeEntry: string = absoluteEntry.split(`${this.project.getBuiltPath()}\\`).join(""); diff --git a/src/packager/Packager.ts b/src/packager/Packager.ts index 1e2ac66..5b9916c 100644 --- a/src/packager/Packager.ts +++ b/src/packager/Packager.ts @@ -16,7 +16,7 @@ export class Packager { public constructor(project: Project) { this.project = project; - const packagePath: string = Path.join(this.project.getPath(), `${this.project.getName()}.zip`); + const packagePath: string = Path.join(this.project.getPath(), `${this.project.getName().replace("/", "-").replace("@", "")}.zip`); this.pluginPackage = new PluginPackage(this.project.getName(), packagePath); } diff --git a/src/packager/PluginPackage.ts b/src/packager/PluginPackage.ts index 88d3232..a3ef835 100644 --- a/src/packager/PluginPackage.ts +++ b/src/packager/PluginPackage.ts @@ -29,7 +29,7 @@ export class PluginPackage { } const pluginPackage: Unzipper.CentralDirectory = await Unzipper.Open.file(this.filePath); - const extractedPath: string = Path.join(destinationPath, this.name); + const extractedPath: string = Path.join(destinationPath, this.name.replace("/", "-").replace("@", "")); await pluginPackage.extract({path: extractedPath}); } }