Skip to content

Commit

Permalink
fix: avoid nullish in template literal
Browse files Browse the repository at this point in the history
  • Loading branch information
mshanemc committed Jun 28, 2024
1 parent 6f3ddc1 commit 94d6c73
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/commands/doctor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ ${this.doctor
// eslint-disable-next-line @typescript-eslint/no-misused-promises
cp.on('exit', async (code) => {
this.doctor.setExitCode(code ?? 0);
await this.doctor.writeStdout(`\nCommand exit code: ${code}\n`);
await this.doctor.writeStdout(`\nCommand exit code: ${code ?? 'null'}\n`);
this.doctor.closeStdout();
this.doctor.closeStderr();
this.filesWrittenMsgs.push(`Wrote command stdout log to: ${stdoutLogLocation}`);
Expand Down
4 changes: 2 additions & 2 deletions src/commands/info/releasenotes/display.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export default class Display extends SfCommand<DisplayOutput | undefined> {
// --hook is passed in the post install/update scripts
const { message, stack, name } = err as Error;

this.warn(`${this.id} failed: ${message}`);
this.warn(`${this.id ?? '<no command id>'} failed: ${message}`);

logger.trace(stack);
await Lifecycle.getInstance().emitTelemetry({
Expand Down Expand Up @@ -136,4 +136,4 @@ export default class Display extends SfCommand<DisplayOutput | undefined> {
export type DisplayOutput = {
body: string;
url: string;
}
};
6 changes: 5 additions & 1 deletion src/doctor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ export type SfDoctor = {
writeStdout(contents: string): Promise<boolean>;
};

type CliConfig = Partial<Interfaces.Config> & { nodeEngine: string };
// oclif has some properties marked as optional in the Interface, but they will be present after Load() is called
type CliConfig = Partial<Interfaces.Config> & { nodeEngine: string } & Pick<
Required<Interfaces.Config>,
'windows' | 'userAgent' | 'shell' | 'channel'
>;

export type SfDoctorDiagnosis = {
versionDetail: Omit<Interfaces.VersionDetails, 'pluginVersions'> & { pluginVersions: string[] };
Expand Down

0 comments on commit 94d6c73

Please sign in to comment.