Skip to content

Commit

Permalink
Fix CLI not using proper package dir
Browse files Browse the repository at this point in the history
  • Loading branch information
The-Best-Codes committed Oct 29, 2024
1 parent 9d9dba0 commit e3f5295
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,18 @@ import { fileURLToPath } from "url";
import { spawn } from "child_process";
import inquirer from "inquirer";

const __dirname = path.dirname(fileURLToPath(import.meta.url));

let currentPackage = {};

// Ensure the package.json exists
try {
const packagePath = path.resolve(process.cwd(), "package.json");
const packagePath = path.resolve(__dirname, "..", "package.json");
currentPackage = JSON.parse(fs.readFileSync(packagePath, "utf-8"));
} catch (err) {
console.error("Could not access package.json", err);
}

const __dirname = path.dirname(fileURLToPath(import.meta.url));
const program = new Command();

program
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "discraft",
"version": "1.4.0",
"version": "1.4.1",
"description": "Best framework for discord bots",
"main": "index.js",
"type": "module",
Expand Down

0 comments on commit e3f5295

Please sign in to comment.