Skip to content

Commit

Permalink
Fix missing credentials error by adding it as the default option (#1447)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ekrekr committed Oct 27, 2023
1 parent ed36a02 commit 3455317
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ lerna-debug.log
**/*.orig

go.sum

.df-credentials.json
2 changes: 1 addition & 1 deletion api/commands/credentials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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")));
}
Expand Down
5 changes: 2 additions & 3 deletions cli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,10 @@ const credentialsOption: INamedOption<yargs.Options> = {
name: "credentials",
option: {
describe: "The location of the credentials JSON file to use.",
default: null
default: CREDENTIALS_FILENAME
},
check: (argv: yargs.Arguments<any>) =>
!argv[credentialsOption.name] ||
assertPathExists(getCredentialsPath(argv[projectDirOption.name], argv[credentialsOption.name]))
getCredentialsPath(argv[projectDirOption.name], argv[credentialsOption.name])
};

const warehouseOption: INamedOption<yargs.PositionalOptions> = {
Expand Down
2 changes: 1 addition & 1 deletion version.bzl
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 3455317

Please sign in to comment.