Skip to content

Commit

Permalink
v1.1.11
Browse files Browse the repository at this point in the history
  • Loading branch information
dakln committed Oct 17, 2024
1 parent bb192d7 commit c88f88f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
15 changes: 12 additions & 3 deletions cli.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
#!/usr/bin/env deno run --allow-read --allow-write --unstable
import { getLibraryDirectory } from "./deps.ts"
import { getLibraryDirectory, path } from "./deps.ts"
import { parseArgs } from "jsr:@std/[email protected]";
import { Colors } from "./deps.ts";
import { buildAddon } from "./cli/main.ts";
import type { AddonType } from "./lib/common.ts";

const __dirname: string = getLibraryDirectory();
//const __dirname: string = getLibraryDirectory();

const VERSION = '1.1.1'
let __dirname: string //= path.dirname(path.fromFileUrl(import.meta.url));

if (import.meta.url.startsWith('file:')) {
__dirname = path.fromFileUrl(import.meta.url);
} else {
// Обработка https: URL
__dirname = new URL(import.meta.url).pathname;
}

const VERSION = '1.1.11'

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

Expand Down
4 changes: 2 additions & 2 deletions cli/create-addon-structure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ export async function createAddonStructure(options: CreateAddonStructureOptions)
await Deno.writeTextFile(`${BUILD_PATH}/c3runtime/instance.js`, instanceFileData);

ADDON_FILES[CONFIG.Type].forEach(async (file) => {

let data = await Deno.readTextFile(path.resolve(LIB_PATH, 'addon_base', CONFIG.Type, file));
const baseAddonDir = path.resolve(LIB_PATH, `addon_base/${CONFIG.Type}`);
let data = await Deno.readTextFile(`${baseAddonDir}/${file}`);
data = data
.replace(/const\s+ADDON_ID\s*=\s*"";/, `const ADDON_ID = ${JSON.stringify(CONFIG.AddonId)};`)
.replace(/const\s+CONFIG\s*=\s*\{\};/, `const CONFIG = ${JSON.stringify(CONFIG)};`)
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.1",
"version": "1.1.11",
"exports": {
".": "./mod.ts",
"./cli": "./cli.ts"
Expand Down

0 comments on commit c88f88f

Please sign in to comment.