feat: add version argument
This commit is contained in:
commit
618e00b677
7 changed files with 1310 additions and 35 deletions
10
index.ts
10
index.ts
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
import fs from "fs";
|
||||
import fs, { readFileSync } from "fs";
|
||||
import { confirm, select, input } from "@inquirer/prompts";
|
||||
import { exit } from "process";
|
||||
import {
|
||||
|
@ -13,14 +13,20 @@ import {
|
|||
} from "./configuration/configuration";
|
||||
import { execSync } from "child_process";
|
||||
import { program } from "commander";
|
||||
import { dirname, join } from "path";
|
||||
import { fileURLToPath } from "bun";
|
||||
|
||||
const packageJson = require("./package.json");
|
||||
export const VERSION = packageJson.version;
|
||||
|
||||
const CLI_NAME = "pcli";
|
||||
|
||||
program
|
||||
.name("project-cli")
|
||||
.description("A cli for managing projects")
|
||||
.version(VERSION)
|
||||
.action(async () => {
|
||||
if (!fs.existsSync(configPath + "config.toml")) {
|
||||
if (!fs.existsSync(configPath + "config.json")) {
|
||||
const createConfig = await confirm({
|
||||
message:
|
||||
"No cofig has been found. Would you like to generate a new one?",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue