MCPcopy Index your code
hub / github.com/devcontainers/cli / createLocalCLIHostFromExecFunctions

Function createLocalCLIHostFromExecFunctions

src/spec-common/cliHost.ts:63–90  ·  view source on GitHub ↗
(localCwd: string, exec: ExecFunction, ptyExec: PtyExecFunction, connect: ConnectFunction)

Source from the content-addressed store, hash-verified

61}
62
63function 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
93function cygwinUnixSocketCookieToBuffer(cookie: string) {

Callers 1

getCLIHostFunction · 0.85

Calls 3

mkdirpLocalFunction · 0.90
homedirMethod · 0.80
tmpdirMethod · 0.80

Tested by

no test coverage detected