Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
BalliAsghar committed Sep 9, 2022
1 parent 90ffbc3 commit 59e9f45
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import chalk from "chalk";
import path from "path";
import { fileURLToPath } from "url";
import open from "open";
import mailsy from "../package.json" assert { type: "json" };

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

Expand Down Expand Up @@ -235,8 +234,12 @@ const openEmail = async (email) => {
}
};

const showVersion = () => {
console.log(`${chalk.blue("Version")}: ${chalk.green(mailsy.version)}`);
const showVersion = async () => {
const { version } = await JSON.parse(
await fs.readFile(path.join(dirname, "../package.json"))
);

console.log(`${chalk.blue("Version")}: ${chalk.green(version)}`);
};

// export the functions using es6 syntax
Expand Down

0 comments on commit 59e9f45

Please sign in to comment.