Skip to content

Commit

Permalink
v1.1.13
Browse files Browse the repository at this point in the history
  • Loading branch information
dakln committed Oct 17, 2024
1 parent 6c18f58 commit 62f8390
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Colors } from "./deps.ts";
import { buildAddon } from "./cli/main.ts";
import type { AddonType } from "./lib/common.ts";

const VERSION = '1.1.12'
const VERSION = '1.1.13'

type LostCommand = 'none' | 'help' | 'version' | 'build' | 'create' | 'serve';

Expand Down Expand Up @@ -80,7 +80,7 @@ async function cloneRepo(url: string, addonType: AddonType) {
if (code === 0) {
console.log('✅', Colors.bold(`${Colors.green('Successfully')} created bare-bones for ${Colors.magenta(`"${addonType}"`)} addon type!`));
} else {
console.error('❌', Colors.red(Colors.bold(`Error occured while creating bare-bones.`)));
console.error('❌', Colors.red(Colors.bold(`Error occured while creating bare-bones.`)), `Error code: ${code}`);
}
}

Expand Down
9 changes: 5 additions & 4 deletions cli/create-addon-structure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { PluginProperty } from "../lib/plugin-props.ts";
import type { LostCategoryDefault } from "../lib/entities.ts";
import type { AddonScript } from "./get-addon-scripts.ts";
import type { AddonFile } from "./get-addon-files.ts";
import { ADDON_BASE_URL, BUILD_PATH, LOCAL_ADDON_BASE_PATH } from "./paths.ts";
import { ADDON_BASE_URL, ADDON_ICON_FOLDER_PATH, BUILD_PATH, LOCAL_ADDON_BASE_PATH } from "./paths.ts";
import type { AddonIcon } from "./get-addon-icon.ts";
import { Project } from "./cli-deps.ts";
import { path } from '../deps.ts';
Expand Down Expand Up @@ -106,6 +106,8 @@ export async function createAddonStructure(options: CreateAddonStructureOptions,
.replace(/const\s+REMOTE_SCRIPTS\s*=\s*\[\];/, `const REMOTE_SCRIPTS = ${JSON.stringify(CONFIG.RemoteScripts || [])};`)
.replace(/const\s+SCRIPTS\s*=\s*\[\];/, `const SCRIPTS = ${JSON.stringify(SCRIPTS)};`)
.replace(/const\s+FILES\s*=\s*\[\];/, `const FILES = ${JSON.stringify(FILES)};`)
.replace(/const\s+ICON_NAME\s*=\s*"";/, `const ICON_NAME = ${JSON.stringify(ICON.filename)};`)
.replace(/const\s+ICON_TYPE\s*=\s*"";/, `const ICON_TYPE = ${JSON.stringify(ICON.type)};`)

await Deno.writeTextFile(path.resolve(BUILD_PATH, fileOrPath), fileContent);

Expand All @@ -116,10 +118,9 @@ export async function createAddonStructure(options: CreateAddonStructureOptions,
}
} else {
if (!ICON.isDefault) {
await Deno.copyFile(`${LOCAL_ADDON_BASE_PATH}/${ICON.filename}`, `${BUILD_PATH}/${ICON.filename}`);
await Deno.copyFile(`${ADDON_ICON_FOLDER_PATH}/${ICON.filename}`, `${BUILD_PATH}/${ICON.filename}`);
} else {
const iconContent = await Deno.readTextFile(`${LOCAL_ADDON_BASE_PATH}/${ICON.filename}`);
await Deno.writeTextFile(`${BUILD_PATH}/${ICON.filename}`, iconContent);
await Deno.copyFile(`${LOCAL_ADDON_BASE_PATH}/${ICON.filename}`, `${BUILD_PATH}/${ICON.filename}`);
}

for await (const fileOrPath of ADDON_FILES[CONFIG.Type]) {
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": "1.1.12",
"version": "1.1.13",
"exports": {
".": "./mod.ts",
"./cli": "./cli.ts"
Expand Down

0 comments on commit 62f8390

Please sign in to comment.