Skip to content

Commit 0d7ccda

Browse files
committed
Also check for undeployed changes
1 parent 84a185c commit 0d7ccda

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

packages/database/scripts/deploy.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ dotenv.config();
55

66
const main = () => {
77
try {
8-
exec("git status -s -b", (err, stdout, stderr) => {
8+
exec("git status -s -b -uno", (err, stdout, stderr) => {
99
if (err) {
1010
console.error("Is git installed?");
1111
process.exit(1);
@@ -15,6 +15,12 @@ const main = () => {
1515
console.log("Not on main branch, not deploying database");
1616
process.exit(0);
1717
}
18+
if (lines.length > 1) {
19+
console.log(
20+
"You seem to have uncommitted changes, not deploying database",
21+
);
22+
process.exit(0);
23+
}
1824
const { SUPABASE_PROJECT_ID, SUPABASE_DB_PASSWORD } = process.env;
1925
if (!SUPABASE_PROJECT_ID) {
2026
console.log("Please define SUPABASE_PROJECT_ID");

0 commit comments

Comments
 (0)