Skip to content

Commit

Permalink
bugfix: Accounted for the location of the installed package (#2)
Browse files Browse the repository at this point in the history
Co-authored-by: ijlee2 <[email protected]>
  • Loading branch information
ijlee2 and ijlee2 authored Jan 16, 2023
1 parent f1089ec commit c167813
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/migration/ember-addon/steps/create-files-from-blueprint.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
import { readFileSync } from 'node:fs';
import { join } from 'node:path';
import { dirname, join } from 'node:path';
import { fileURLToPath } from 'node:url';

import glob from 'glob';

import { createFiles } from '../../../utils/files.js';
import { processTemplate } from '../../../utils/process-template.js';

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);

function getBlueprintRoot() {
const codemodRoot = join(__dirname, '../../../..');

return join(codemodRoot, 'src/blueprints/ember-addon');
}

function getFilePath(blueprintFilePath, options) {
const { locations } = options;

Expand Down Expand Up @@ -36,7 +46,7 @@ function getFilesToSkip(options) {
}

export function createFilesFromBlueprint(context, options) {
const blueprintRoot = 'src/blueprints/ember-addon';
const blueprintRoot = getBlueprintRoot();

const filesToSkip = getFilesToSkip(options);

Expand Down

0 comments on commit c167813

Please sign in to comment.