Merge branch 'master' into vinzscam/create-app-add-bsversion-file
This commit is contained in:
@@ -25,7 +25,7 @@ jest.mock('./lib/tasks');
|
||||
|
||||
beforeAll(() => {
|
||||
mockFs({
|
||||
'package.json': '', // required by `findPaths(__dirname)`
|
||||
[`${__dirname}/package.json`]: '', // required by `findPaths(__dirname)`
|
||||
'templates/': mockFs.load(path.resolve(__dirname, '../templates/')),
|
||||
});
|
||||
});
|
||||
|
||||
@@ -20,7 +20,13 @@ import fs from 'fs-extra';
|
||||
import handlebars from 'handlebars';
|
||||
import ora from 'ora';
|
||||
import recursive from 'recursive-readdir';
|
||||
import { basename, dirname, join, resolve as resolvePath } from 'path';
|
||||
import {
|
||||
basename,
|
||||
dirname,
|
||||
join,
|
||||
resolve as resolvePath,
|
||||
relative as relativePath,
|
||||
} from 'path';
|
||||
import { exec as execCb } from 'child_process';
|
||||
import { packageVersions } from './versions';
|
||||
import { promisify } from 'util';
|
||||
@@ -87,7 +93,10 @@ export async function templatingTask(
|
||||
});
|
||||
|
||||
for (const file of files) {
|
||||
const destinationFile = file.replace(templateDir, destinationDir);
|
||||
const destinationFile = resolvePath(
|
||||
destinationDir,
|
||||
relativePath(templateDir, file),
|
||||
);
|
||||
await fs.ensureDir(dirname(destinationFile));
|
||||
|
||||
if (file.endsWith('.hbs')) {
|
||||
|
||||
Reference in New Issue
Block a user