Skip to content

schema commands require project even when secret option provided #413

@ptpaterson

Description

@ptpaterson

The --secret option effectively escapes out of most project configuration options, but schema command initialization always requires a project.

async init() {
await super.init();
if (this.flags?.dir !== undefined) {
this.dir = this.flags.dir;
} else if (this.shellConfig?.projectPath !== undefined) {
if (this.shellConfig.projectConfig?.schemaDir !== undefined) {
this.dir = path.join(
this.shellConfig.projectPath,
this.shellConfig.projectConfig.schemaDir
);
} else {
this.dir = this.shellConfig.projectPath;
}
if (!dirExists(this.dir)) {
this.error(`The project fsl directory: ${this.dir} does not exist.`);
} else if (!dirIsWriteable(this.dir)) {
this.error(`The project fsl directory: ${this.dir} is not writeable.`);
}
} else {
this.error(
"No project found. Create a project with `fauna project init`."
);
}
}

When --secret is used with schema commit, and schema abandon commands, we should not require a project configuration.

Workarounds in the meantime

You can, of course, create a dummy project, but that's a lot of work.

you can add a dummy directory `--dir .' for example:

fauna schema abandon --secret xxxxxxxx --dir .

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions