diff --git a/cli.ts b/cli.ts index 6b3822b..4054fce 100644 --- a/cli.ts +++ b/cli.ts @@ -66,7 +66,11 @@ async function main() { `) break; case 'create': - if (!flags.plugin) { + if ( + !flags.plugin && + !flags.behavior && + !flags["drawing-plugin"] + ) { Logger.Log('🎓', Colors.blue(Colors.italic('Specify one of the available types of addon:'))) printCreate(); break; @@ -119,6 +123,7 @@ async function installTypes() { const fileContent = await response.text(); await Deno.writeTextFile(join(Paths.Main, 'Addon', 'Types', 'construct.d.ts'), fileContent); + Logger.Success(Colors.bold(`${Colors.green('Successfully')} installed construct types!`)); } catch (e) { Logger.Error('cli', 'Error while installing construct types file', `Error: ${e}`); Deno.exit(1); @@ -128,7 +133,7 @@ async function installTypes() { async function createBareBones(type: AddonBareBonesType) { Logger.Process(`Creating bare-bones for ${Colors.magenta(`"${type}"`)} addon type`); await cloneRepo(Paths.BareBones[type]); - await installTypes(); + switch (type) { case "plugin": await downloadAddonBase('plugin'); @@ -153,6 +158,7 @@ async function cloneRepo(url: string) { if (code === 0) { Logger.Success(Colors.bold(`${Colors.green('Successfully')} created bare-bones!`)); + await installTypes(); } else { Logger.Error('cli', 'Error occured while creating bare-bones.', `Error code: ${code}`); } diff --git a/cli/check-addon-base-exists.ts b/cli/check-addon-base-exists.ts index 41ea2d3..5cb7b5b 100644 --- a/cli/check-addon-base-exists.ts +++ b/cli/check-addon-base-exists.ts @@ -1,5 +1,5 @@ import DenoJson from '../deno.json' with { type: "json" }; -import { join, Logger } from "../deps.ts"; +import { Colors, join, Logger } from "../deps.ts"; import type { AddonType } from "../lib/config.ts"; import { Paths } from "../shared/paths.ts"; @@ -26,6 +26,7 @@ export async function downloadAddonBase(addonType: AddonType) { await Deno.writeTextFile(join(Paths.Main, Paths.AddonBaseFolderName, 'metadata.json'), JSON.stringify(metadata, null, 4)); await Deno.writeTextFile(Paths.LocalAddonBase[addonType], fileContent); + Logger.Success(Colors.bold(`${Colors.green('Successfully')} installed addon base!`)); } diff --git a/deno.json b/deno.json index 3bd0ea2..f1c3983 100644 --- a/deno.json +++ b/deno.json @@ -1,6 +1,6 @@ { "name": "@lost-c3/lib", - "version": "3.2.2", + "version": "3.2.3", "exports": { ".": "./mod.ts", "./cli": "./cli.ts",