Skip to content

Commit 43a44e2

Browse files
committed
refactor
1 parent 4ce6111 commit 43a44e2

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/client/common/platform/pathUtils.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,11 @@ export class PathUtils implements IPathUtils {
2323
}
2424
public getDisplayName(pathValue: string, cwd?: string): string {
2525
if (cwd && pathValue.startsWith(cwd)) {
26-
pathValue = `.${path.sep}${path.relative(cwd, pathValue)}`;
26+
return `.${path.sep}${path.relative(cwd, pathValue)}`;
27+
} else if (pathValue.startsWith(this.home)) {
28+
return `~${path.sep}${path.relative(this.home, pathValue)}`;
29+
} else {
30+
return pathValue;
2731
}
28-
if (pathValue.startsWith(this.home)) {
29-
pathValue = `~${path.sep}${path.relative(this.home, pathValue)}`;
30-
}
31-
return pathValue;
3232
}
33-
3433
}

0 commit comments

Comments
 (0)