Skip to content
Merged
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
16 changes: 7 additions & 9 deletions src/commands/schema/diff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,14 @@ export default class DiffSchemaCommand extends SchemaCommand {
this.log(
`Differences from the ${bold()}remote${reset()} schema to the ${bold()}local${reset()} schema:`
);
} else if (source === "active") {
this.log(
`Differences from the ${bold()}remote, active${reset()} schema to the ${bold()}local${reset()} schema:`
);
Comment on lines +100 to +103
Copy link
Contributor Author

Choose a reason for hiding this comment

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

eslint suggested simplifying this conditional - feel like i agree.

} else {
if (source === "active") {
this.log(
`Differences from the ${bold()}remote, active${reset()} schema to the ${bold()}local${reset()} schema:`
);
} else {
this.log(
`Differences from the ${bold()}remote, staged${reset()} schema to the ${bold()}local${reset()} schema:`
);
}
this.log(
`Differences from the ${bold()}remote, staged${reset()} schema to the ${bold()}local${reset()} schema:`
);
}
this.log(json.diff ? json.diff : "No schema differences");
}
Expand Down
14 changes: 7 additions & 7 deletions src/commands/schema/pull.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,18 +99,18 @@ export default class PullSchemaCommand extends SchemaCommand {
console.log(`overwrite: ${overwrite}`);
}

if (this.flags?.delete) {
// Delete extra .fsl files.
for (const deleteme of deletes) {
fs.unlinkSync(path.join(this.dir, deleteme));
}
}

const confirmed = await confirm({
message: "Accept the changes?",
default: false,
});
if (confirmed) {
if (this.flags?.delete) {
// Delete extra .fsl files.
for (const deleteme of deletes) {
fs.unlinkSync(path.join(this.dir, deleteme));
}
}

for (const filename of filenames) {
const fileres = await fetch(
new URL(`/schema/1/files/${encodeURIComponent(filename)}`, url),
Expand Down