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

Function createFile

src/spec-common/injectHeadless.ts:574–581  ·  view source on GitHub ↗
(shellServer: ShellServer, location: string)

Source from the content-addressed store, hash-verified

572}
573
574async function createFile(shellServer: ShellServer, location: string) {
575 try {
576 await shellServer.exec(createFileCommand(location));
577 return true;
578 } catch (err) {
579 return false;
580 }
581}
582
583export function createFileCommand(location: string) {
584 return `test ! -f '${location}' && set -o noclobber && mkdir -p '${path.posix.dirname(location)}' && { > '${location}' ; } 2> /dev/null`;

Callers 2

patchEtcEnvironmentFunction · 0.85
patchEtcProfileFunction · 0.85

Calls 2

createFileCommandFunction · 0.85
execMethod · 0.65

Tested by

no test coverage detected