MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / standIn

Function standIn

__tests__/windows-powershell-module-path.test.ts:165–173  ·  view source on GitHub ↗

A module newer than Windows PowerShell's own, whose one command fails.

(name: string, command: string, message: string)

Source from the content-addressed store, hash-verified

163
164 /** A module newer than Windows PowerShell's own, whose one command fails. */
165 function standIn(name: string, command: string, message: string): void {
166 const at = path.join(shadow, name, '99.0.0');
167 fs.mkdirSync(at, { recursive: true });
168 fs.writeFileSync(path.join(at, `${name}.psm1`), `function ${command} { throw ${psq(message)} }\nExport-ModuleMember -Function ${command}\n`);
169 fs.writeFileSync(
170 path.join(at, `${name}.psd1`),
171 `@{ RootModule = '${name}.psm1'; ModuleVersion = '99.0.0'; GUID = 'b2f1c0de-0000-4000-8000-000000000002'; FunctionsToExport = @('${command}') }\n`,
172 );
173 }
174
175 beforeAll(async () => {
176 dir = fs.mkdtempSync(path.join(os.tmpdir(), 'cg-psmodulepath-'));

Calls 2

psqFunction · 0.70
joinMethod · 0.45

Tested by

no test coverage detected