mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Improve local shell CWD setting (#4396)
This commit is contained in:
1 parent
8f84f394fe
commit
7c5a0a9a6d
7 files changed
+422
-120
No files matched your search
@@ -22,9 +22,13 @@
|
||||
import path from "path";
|
||||
import os from "os";
|
||||
|
||||
function resolveTilde(filePath: string) {
|
||||
if (filePath[0] === "~" && (filePath[1] === "/" || filePath.length === 1)) {
|
||||
return filePath.replace("~", os.homedir());
|
||||
export function resolveTilde(filePath: string) {
|
||||
if (filePath === "~") {
|
||||
return os.homedir();
|
||||
}
|
||||
|
||||
if (filePath.startsWith("~/")) {
|
||||
return `${os.homedir()}${filePath.slice(1)}`;
|
||||
}
|
||||
|
||||
return filePath;
|
||||
|
||||
Reference in new issue
Block a user