MCPcopy Create free account
hub / github.com/mikro-orm/mikro-orm / initPaths

Function initPaths

packages/core/src/utils/AbstractMigrator.ts:422–440  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

420 }
421
422 protected async initPaths(): Promise<void> {
423 if (this.absolutePath || this.options.migrationsList) {
424 return;
425 }
426
427 const { fs } = await import('@mikro-orm/core/fs-utils');
428 this.detectSourceFolder(fs);
429
430 /* v8 ignore next */
431 const key = this.config.get('preferTs', Utils.detectTypeScriptSupport()) && this.options.pathTs ? 'pathTs' : 'path';
432 this.absolutePath = fs.absolutePath(this.options[key]!, this.config.get('baseDir'));
433
434 try {
435 fs.ensureDir(this.absolutePath);
436 } catch {
437 // read-only filesystem — read-only operations (e.g. `getPending` with a
438 // snapshot) may still succeed; write operations will fail on their own
439 }
440 }
441
442 protected initServices(): void {
443 this.runner = this.createRunner();

Callers

nothing calls this directly

Calls 5

detectSourceFolderMethod · 0.80
absolutePathMethod · 0.80
ensureDirMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected