Skip to content

Commit

Permalink
confirms before running the script so you can save your .env etc (#4133)
Browse files Browse the repository at this point in the history
  • Loading branch information
peterpme authored Jun 6, 2023
1 parent c0cfd99 commit deb39a9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"start:fresh": "yarn install && yarn clean && yarn install && yarn start",
"test": "env-cmd --silent turbo run test -- --passWithNoTests --watchAll=false",
"build": "env-cmd --silent turbo run build --filter='!./examples/**' ",
"build:fresh": "git clean -xfd && yarn install && yarn build --force",
"build:fresh": "node scripts/confirm-before-build-fresh.js && git clean -xfd && yarn install && yarn build --force",
"e2e": "env-cmd --silent turbo run e2e",
"clean": "git clean -xfd",
"start:ext": "env-cmd --silent turbo run start --filter='@coral-xyz/app-extension...' --filter='@coral-xyz/background...'",
Expand Down
17 changes: 17 additions & 0 deletions scripts/confirm-before-build-fresh.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const readline = require("node:readline");
const { stdin: input, stdout: output } = require("node:process");

const rl = readline.createInterface({ input, output });

rl.question(
"Did you save your .env files (backpack-api, etc)? (y/n)",
(answer) => {
if (answer === "y") {
console.log("Running build:fresh");
rl.close();
} else {
console.log("Exiting. Good save.");
process.exit(1);
}
}
);

1 comment on commit deb39a9

@vercel
Copy link

@vercel vercel bot commented on deb39a9 Jun 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.