Skip to content

Commit

Permalink
remove --dir option from schema commands that don't use it
Browse files Browse the repository at this point in the history
  • Loading branch information
echo-bravo-yahoo committed Dec 9, 2024
1 parent 38f5cab commit 2603041
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
2 changes: 2 additions & 0 deletions src/commands/schema/diff.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
} from "../../lib/command-helpers.mjs";
import { getSecret } from "../../lib/fauna-client.mjs";
import { reformatFSL } from "../../lib/schema.mjs";
import { localSchemaOptions } from "./schema.mjs";

/**
* @returns string[]
Expand Down Expand Up @@ -129,6 +130,7 @@ function buildDiffCommand(yargs) {
default: false,
type: "boolean",
},
...localSchemaOptions,
})
.example([
[
Expand Down
2 changes: 2 additions & 0 deletions src/commands/schema/pull.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
yargsWithCommonQueryOptions,
} from "../../lib/command-helpers.mjs";
import { getSecret } from "../../lib/fauna-client.mjs";
import { localSchemaOptions } from "./schema.mjs";

async function determineFileState(argv, filenames) {
const gatherFSL = container.resolve("gatherFSL");
Expand Down Expand Up @@ -142,6 +143,7 @@ function buildPullCommand(yargs) {
type: "boolean",
default: false,
},
...localSchemaOptions,
})
.example([
[
Expand Down
2 changes: 2 additions & 0 deletions src/commands/schema/push.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { container } from "../../cli.mjs";
import { yargsWithCommonQueryOptions } from "../../lib/command-helpers.mjs";
import { getSecret } from "../../lib/fauna-client.mjs";
import { reformatFSL } from "../../lib/schema.mjs";
import { localSchemaOptions } from "./schema.mjs";

async function doPush(argv) {
const logger = container.resolve("logger");
Expand Down Expand Up @@ -99,6 +100,7 @@ function buildPushCommand(yargs) {
type: "boolean",
default: false,
},
...localSchemaOptions,
})
.example([
[
Expand Down
19 changes: 10 additions & 9 deletions src/commands/schema/schema.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,18 @@ import pullCommand from "./pull.mjs";
import pushCommand from "./push.mjs";
import statusCommand from "./status.mjs";

export const localSchemaOptions = {
"project-directory": {
alias: ["directory", "dir"],
type: "string",
description:
"Path to a local directory containing `.fsl` files for the database.",
default: ".",
},
};

function buildSchema(yargs) {
return yargs
.options({
"project-directory": {
alias: ["directory", "dir"],
type: "string",
description:
"Path to a local directory containing `.fsl` files for the database.",
default: ".",
},
})
.command(abandonCommand)
.command(commitCommand)
.command(diffCommand)
Expand Down

0 comments on commit 2603041

Please sign in to comment.