MCPcopy Create free account
hub / github.com/zenstackhq/zenstack / runResolve

Function runResolve

packages/cli/src/actions/migrate.ts:129–145  ·  view source on GitHub ↗
(prismaSchemaFile: string, options: ResolveOptions)

Source from the content-addressed store, hash-verified

127}
128
129function runResolve(prismaSchemaFile: string, options: ResolveOptions) {
130 if (!options.applied && !options.rolledBack) {
131 throw new CliError('Either --applied or --rolled-back option must be provided');
132 }
133
134 try {
135 const cmd = [
136 'migrate resolve',
137 ` --schema "${prismaSchemaFile}"`,
138 options.applied ? ` --applied "${options.applied}"` : '',
139 options.rolledBack ? ` --rolled-back "${options.rolledBack}"` : '',
140 ].join('');
141 execPrisma(cmd);
142 } catch (err) {
143 handleSubProcessError(err);
144 }
145}
146
147function handleSubProcessError(err: unknown) {
148 if (err instanceof Error && 'status' in err && typeof err.status === 'number') {

Callers 1

runFunction · 0.85

Calls 2

execPrismaFunction · 0.90
handleSubProcessErrorFunction · 0.70

Tested by

no test coverage detected