Skip to content

Commit

Permalink
Add example command for dealing with .env files
Browse files Browse the repository at this point in the history
  • Loading branch information
aedart committed Oct 11, 2024
1 parent 949e20e commit 5b61dbd
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion packages/cli/bin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,30 @@

import { program } from "commander";
import { VERSION } from "@aedart/cli";
import { loadEnvFile } from "node:process";

// TODO: Incomplete... how to obtain additional commands? Should this be wrapped?

program
.version(VERSION)
.description(`Ion CLI v${VERSION} in ${process.cwd()}`)
.description(`Ion CLI v${VERSION} in ${process.cwd()}`);

program
.command('fisk', )
.description('Bla bla')
.argument('name', 'More bla bla')
.action((name) => {
console.info('Sweet', name);
});
program
.command('read')
.description('.env example')
.action(() => {
// Loads .env file from process.cwd(), unless other file is specified.
loadEnvFile();

console.log(process.env);
});

// TODO: Add commands...

Expand Down

0 comments on commit 5b61dbd

Please sign in to comment.