Skip to content

Commit

Permalink
fix: wrong operator
Browse files Browse the repository at this point in the history
  • Loading branch information
viceice committed Aug 21, 2023
1 parent fdc0dc6 commit b6db7bd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cli/services/version.service.ts
Expand Up @@ -11,10 +11,11 @@ export class VersionService {
async find(tool: string): Promise<string | null> {
const path = join(this.pathSvc.versionPath, tool);
try {
return (await readFile(path, { encoding: 'utf8' })).trim() ?? null;
return (await readFile(path, { encoding: 'utf8' })).trim() || null;
} catch (err) {
if (err instanceof Error && err.code === 'ENOENT') {
logger.debug({ tool }, 'tool version not found');
/* c8 ignore next 3 */
} else {
logger.error({ tool, err }, 'tool version not found');
}
Expand Down

0 comments on commit b6db7bd

Please sign in to comment.