-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2e292f3
commit 1a72b8a
Showing
2 changed files
with
28 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { readFileSync } from "node:fs"; | ||
import { fileURLToPath } from "node:url"; | ||
|
||
import { defineCommand } from "citty"; | ||
import path from "pathe"; | ||
|
||
const __filename = fileURLToPath(import.meta.url); // get the resolved path to the file | ||
const __dirname = path.dirname(__filename); // get the name of the directory | ||
|
||
const version = defineCommand({ | ||
meta: { | ||
name: "Version", | ||
description: "Get the current Arri CLI version", | ||
}, | ||
run() { | ||
const packageJson = JSON.parse( | ||
readFileSync(path.resolve(__dirname, "../package.json"), { | ||
encoding: "utf8", | ||
}), | ||
); | ||
console.info(`${packageJson.version}`); | ||
}, | ||
}); | ||
|
||
export default version; |