Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/short-hairs-tease.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cartesi/cli": patch
---

ignore .env file when using cartesi run
12 changes: 12 additions & 0 deletions apps/cli/src/commands/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,14 @@ export default class Run extends BaseCommand<typeof Run> {
process.on("SIGINT", () => {});

try {
// mask .env
if (fs.existsSync("./.env")) {
this.warn(
"Ignoring .env file. You should create a .cartesi.env if you want to set environment variables for the rollups-node.",
);
await fs.rename(".env", ".masked.env");
}

if (flags["dry-run"]) {
// show the docker compose configuration
await execa("docker", [...compose_args, "config"], {
Expand All @@ -217,6 +225,10 @@ export default class Run extends BaseCommand<typeof Run> {
env,
stdio: "inherit",
});
// unmask .env
if (fs.existsSync("./.masked.env")) {
await fs.rename(".masked.env", ".env");
}
}
}
}