From 8d426bd811fb1c6931270f6c8c4437868859b347 Mon Sep 17 00:00:00 2001 From: Elias Kassell Date: Mon, 13 Feb 2023 14:14:52 +0000 Subject: [PATCH] Fix missing credentials error by adding it as the default option (#1447) --- .gitignore | 2 ++ api/commands/credentials.ts | 2 +- cli/index.ts | 5 ++--- version.bzl | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 14a72b871..379db1187 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,5 @@ lerna-debug.log **/*.orig go.sum + +.df-credentials.json diff --git a/api/commands/credentials.ts b/api/commands/credentials.ts index afbb18268..b4a2cf7c8 100644 --- a/api/commands/credentials.ts +++ b/api/commands/credentials.ts @@ -15,7 +15,7 @@ export type Credentials = export function read(warehouse: string, credentialsPath: string): Credentials { if (!fs.existsSync(credentialsPath)) { - throw new Error("Missing credentials JSON file."); + throw new Error(`Missing credentials JSON file; not found at path '${credentialsPath}'.`); } return coerce(warehouse, JSON.parse(fs.readFileSync(credentialsPath, "utf8"))); } diff --git a/cli/index.ts b/cli/index.ts index 05f1db163..1b44e2f79 100644 --- a/cli/index.ts +++ b/cli/index.ts @@ -154,11 +154,10 @@ const credentialsOption: INamedOption = { name: "credentials", option: { describe: "The location of the credentials JSON file to use.", - default: null + default: CREDENTIALS_FILENAME }, check: (argv: yargs.Arguments) => - !argv[credentialsOption.name] || - assertPathExists(getCredentialsPath(argv[projectDirOption.name], argv[credentialsOption.name])) + getCredentialsPath(argv[projectDirOption.name], argv[credentialsOption.name]) }; const warehouseOption: INamedOption = { diff --git a/version.bzl b/version.bzl index ba7c014ca..7b7d699af 100644 --- a/version.bzl +++ b/version.bzl @@ -1,3 +1,3 @@ # NOTE: If you change the format of this line, you must change the bash command # in /scripts/publish to extract the version string correctly. -DF_VERSION = "2.3.0" +DF_VERSION = "2.3.1"