Skip to content

Commit

Permalink
move to --no-input instead of --force
Browse files Browse the repository at this point in the history
  • Loading branch information
echo-bravo-yahoo committed Oct 21, 2024
1 parent d4ce8d3 commit fe7b3a6
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 23 deletions.
10 changes: 5 additions & 5 deletions src/commands/schema/abandon.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ async function doAbandon(argv) {
const logger = container.resolve("logger");
const confirm = container.resolve("confirm");

if (argv.force) {
if (!argv.input) {
const params = new URLSearchParams({
force: "true", // Just abandon, don't pass a schema version through.
});
Expand Down Expand Up @@ -62,10 +62,10 @@ async function doAbandon(argv) {
function buildAbandonCommand(yargs) {
return yargs
.options({
force: {
description: "Push the change without a diff or schema version check",
type: "boolean",
default: false,
input: {
description: "Prompt for user input (e.g., confirmations)",
default: true,
type: "boolean"
},
...commonQueryOptions,
})
Expand Down
10 changes: 5 additions & 5 deletions src/commands/schema/commit.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ async function doCommit(argv) {
const logger = container.resolve("logger");
const confirm = container.resolve("confirm");

if (argv.force) {
if (!argv.input) {
const params = new URLSearchParams({
force: "true", // Just commit, don't pass a schema version through.
});
Expand Down Expand Up @@ -66,10 +66,10 @@ async function doCommit(argv) {
function buildCommitCommand(yargs) {
return yargs
.options({
force: {
description: "Push the change without a diff or schema version check",
type: "boolean",
default: false,
input: {
description: "Prompt for user input (e.g., confirmations)",
default: true,
type: "boolean"
},
...commonQueryOptions,
})
Expand Down
12 changes: 6 additions & 6 deletions src/commands/schema/push.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ async function doPush(argv) {
const gatherFSL = container.resolve("gatherFSL");
const fsl = reformatFSL(await gatherFSL(argv.dir));

if (argv.force) {
if (!argv.input) {
const params = new URLSearchParams({
force: argv.force,
force: "true",
staged: argv.staged ? "true" : "false",
});

Expand Down Expand Up @@ -77,10 +77,10 @@ async function doPush(argv) {
function buildPushCommand(yargs) {
return yargs
.options({
force: {
description: "Push the change without a diff or schema version check",
type: "boolean",
default: false,
input: {
description: "Prompt for user input (e.g., confirmations)",
default: true,
type: "boolean"
},
staged: {
description:
Expand Down
4 changes: 2 additions & 2 deletions test/schema/abandon.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe("schema abandon", function () {
confirm = container.resolve("confirm");
});

it("can force abandon a staged schema change", async function () {
it("can abandon a staged schema change without user input", async function () {
fetch.onCall(0).resolves(
f({
version: 1728677726190000,
Expand All @@ -33,7 +33,7 @@ describe("schema abandon", function () {
}),
);

await run(`schema abandon --secret "secret" --force`, container);
await run(`schema abandon --secret "secret" --no-input`, container);

expect(fetch).to.have.been.calledOnce;
expect(fetch).to.have.been.calledWith(
Expand Down
4 changes: 2 additions & 2 deletions test/schema/commit.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ describe("schema commit", function () {
);
});

it("can force commit a schema change", async function () {
it("can commit a schema change without user input", async function () {
fetch.onCall(0).resolves(f({ version: 1728684456180000 }));

await run(`schema commit --secret "secret" --force`, container);
await run(`schema commit --secret "secret" --no-input`, container);

expect(fetch).to.have.been.calledOnce;
expect(fetch).to.have.been.calledWith(
Expand Down
6 changes: 3 additions & 3 deletions test/schema/push.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ describe("schema push", function () {
gatherFSL.resolves(fsl);
});

it("can force push schema", async function () {
await run(`schema push --secret "secret" --force`, container);
it("can push a schema without user input", async function () {
await run(`schema push --secret "secret" --no-input`, container);

expect(gatherFSL).to.have.been.calledWith(".");

Expand Down Expand Up @@ -166,7 +166,7 @@ describe("schema push", function () {

it("can push schema from another directory", async function () {
await run(
`schema push --secret "secret" --force --dir "/absolute/path/elsewhere"`,
`schema push --secret "secret" --no-input --dir "/absolute/path/elsewhere"`,
container,
);

Expand Down

0 comments on commit fe7b3a6

Please sign in to comment.