Skip to content

Commit 36f5493

Browse files
authored
Fix help panel remote (#1374)
1 parent 0605996 commit 36f5493

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/helpViewer/helpPreviewer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export class RLocalHelpPreviewer {
103103

104104
private readonly dummyPackageName: string;
105105

106-
constructor(options: RHelpPreviewerOptions, packageDir: string, unnamedId: number = 1){
106+
constructor(options: RHelpPreviewerOptions, packageDir: string, unnamedId: number = 1) {
107107
this.packageDir = packageDir;
108108
this.descriptionPath = path.join(this.packageDir, 'DESCRIPTION');
109109
this.manDir = path.join(this.packageDir, 'man');

src/util.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -621,18 +621,18 @@ export function readdirSyncSafe(
621621

622622
export function statSyncSafe(path: fs.PathLike): fs.Stats | undefined {
623623
try {
624-
return fs.statSync(path);
624+
return fs.statSync(path, { throwIfNoEntry: false });
625625
} catch (e) {
626-
626+
return undefined;
627627
}
628628
}
629629

630630
export function isDirSafe(path: fs.PathLike): boolean {
631-
return !!fs.statSync(path, {throwIfNoEntry: false})?.isDirectory();
631+
return !!statSyncSafe(path)?.isDirectory();
632632
}
633633

634634
export function isFileSafe(path: fs.PathLike): boolean {
635-
return !!fs.statSync(path, {throwIfNoEntry: false})?.isFile();
635+
return !!statSyncSafe(path)?.isFile();
636636
}
637637

638638
// Keeps only the unique entries in an array, optionally with a custom comparison function

0 commit comments

Comments
 (0)