Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Leref committed Jan 30, 2024
1 parent ac0a3f2 commit 1dfd43f
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 7 deletions.
10 changes: 7 additions & 3 deletions dist/help.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import chalk from "chalk";
import fs from "fs";
// get latest package version
const { version } = JSON.parse(fs.readFileSync(new URL("../package.json", import.meta.url).pathname.slice(1), "utf-8"));
import { fileURLToPath } from 'url';
import { dirname } from 'path';
import fs from 'fs';
const __filename = fileURLToPath(import.meta.url);
dirname(__filename);
const packageJsonPath = new URL('../package.json', import.meta.url);
const { version } = JSON.parse(fs.readFileSync(fileURLToPath(packageJsonPath), 'utf-8'));
console.log(`
${chalk.cyan("@akarui/aoi.cli")} ${chalk.cyan.bold(`v${version}`)}
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"type": "git",
"url": "https://github.com/AkaruiDevelopment/create-aoijs-bot.git"
},
"global": true,
"keywords": [
"aoijs",
"cli"
Expand Down
15 changes: 15 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 8 additions & 3 deletions src/help.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import chalk from "chalk";
import fs from "fs";
import { fileURLToPath } from 'url';
import { dirname } from 'path';
import fs from 'fs';

// get latest package version
const { version } = JSON.parse(fs.readFileSync(new URL("../package.json", import.meta.url).pathname.slice(1), "utf-8"));
const __filename = fileURLToPath(import.meta.url);
dirname(__filename);

const packageJsonPath = new URL('../package.json', import.meta.url);
const { version } = JSON.parse(fs.readFileSync(fileURLToPath(packageJsonPath), 'utf-8'));

console.log(`
${chalk.cyan("@akarui/aoi.cli")} ${chalk.cyan.bold(`v${version}`)}
Expand Down

0 comments on commit 1dfd43f

Please sign in to comment.