Skip to content

Commit

Permalink
allow CLI flags to be set using env variables
Browse files Browse the repository at this point in the history
We had a problem that while deploying we couldn't change the CLI
command. However, we can add env variables. This commit solves the given
problem. All flags can now optionally be added as env variables. They
need to be prefixed with NEUME.

For example, the below commands are equal
- npx neume crawl --from 0
- NEUME_FROM=0 npx neume crawl
  • Loading branch information
il3ven committed Feb 16, 2023
1 parent 7f3a455 commit 7a2a215
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions dist/neume.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import init from "./commands/init.js";
import { db } from "./database/index.js";
const argv = yargs(hideBin(process.argv))
.usage("Usage: $0 <command> <options>")
.env("NEUME")
.command("crawl", "Find new NFTs from the list of already known contracts", {
from: {
type: "number",
Expand Down
1 change: 1 addition & 0 deletions neume.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { db } from "./database/index.js";

const argv = yargs(hideBin(process.argv))
.usage("Usage: $0 <command> <options>")
.env("NEUME")
.command(
"crawl",
"Find new NFTs from the list of already known contracts",
Expand Down

0 comments on commit 7a2a215

Please sign in to comment.