(localCwd: string, exec: ExecFunction, ptyExec: PtyExecFunction, connect: ConnectFunction)
| 61 | } |
| 62 | |
| 63 | function createLocalCLIHostFromExecFunctions(localCwd: string, exec: ExecFunction, ptyExec: PtyExecFunction, connect: ConnectFunction): CLIHost { |
| 64 | return { |
| 65 | type: 'local', |
| 66 | platform: process.platform, |
| 67 | arch: process.arch, |
| 68 | exec, |
| 69 | ptyExec, |
| 70 | cwd: localCwd, |
| 71 | env: process.env, |
| 72 | path: path, |
| 73 | homedir: async () => os.homedir(), |
| 74 | tmpdir: async () => os.tmpdir(), |
| 75 | isFile: isLocalFile, |
| 76 | isFolder: isLocalFolder, |
| 77 | readFile: readLocalFile, |
| 78 | writeFile: writeLocalFile, |
| 79 | rename: renameLocal, |
| 80 | mkdirp: async (dirpath) => { |
| 81 | await mkdirpLocal(dirpath); |
| 82 | }, |
| 83 | readDir: readLocalDir, |
| 84 | getUsername: getLocalUsername, |
| 85 | getuid: process.platform === 'linux' || process.platform === 'darwin' ? async () => process.getuid!() : undefined, |
| 86 | getgid: process.platform === 'linux' || process.platform === 'darwin' ? async () => process.getgid!() : undefined, |
| 87 | toCommonURI: async (filePath) => URI.file(filePath), |
| 88 | connect, |
| 89 | }; |
| 90 | } |
| 91 | |
| 92 | // Parse a Cygwin socket cookie string to a raw Buffer |
| 93 | function cygwinUnixSocketCookieToBuffer(cookie: string) { |
no test coverage detected