MCPcopy Create free account
hub / github.com/ReactiveX/rxjs / assertWritableOutput

Function assertWritableOutput

packages/migrate/src/node.ts:155–164  ·  view source on GitHub ↗
(outputPath: string, overwrite: boolean)

Source from the content-addressed store, hash-verified

153}
154
155async function assertWritableOutput(outputPath: string, overwrite: boolean): Promise<void> {
156 try {
157 const outputStats = await lstat(outputPath);
158 if (outputStats.isSymbolicLink()) throw new Error(`Refusing to overwrite a symbolic link: ${outputPath}`);
159 if (!outputStats.isFile()) throw new Error(`Output path is not a regular file: ${outputPath}`);
160 if (!overwrite) throw new Error(`Output path already exists; enable overwrite explicitly: ${outputPath}`);
161 } catch (error: unknown) {
162 if (!isMissingPathError(error)) throw error;
163 }
164}
165
166export async function migrateTestFiles(options: MigrateFilesOptions): Promise<readonly MigratedFile[]> {
167 if (options.write && !options.outputRoot) {

Callers 1

preflightPlanOutputsFunction · 0.85

Calls 1

isMissingPathErrorFunction · 0.70

Tested by

no test coverage detected