Skip to content

Commit

Permalink
3.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
dakln committed Dec 8, 2024
1 parent 40ff1e8 commit 70af5d6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
10 changes: 8 additions & 2 deletions cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -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');
Expand All @@ -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}`);
}
Expand Down
3 changes: 2 additions & 1 deletion cli/check-addon-base-exists.ts
Original file line number Diff line number Diff line change
@@ -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";

Expand All @@ -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!`));
}


Expand Down
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lost-c3/lib",
"version": "3.2.2",
"version": "3.2.3",
"exports": {
".": "./mod.ts",
"./cli": "./cli.ts",
Expand Down

0 comments on commit 70af5d6

Please sign in to comment.