chore: renaming to use targetPath rather than templatePath like the rest of the preparers
This commit is contained in:
@@ -28,7 +28,7 @@ describe('File preparer', () => {
|
||||
const preparer = new FilePreparer();
|
||||
const root = os.platform() === 'win32' ? 'C:\\' : '/';
|
||||
const workspacePath = path.join(root, 'tmp');
|
||||
const checkoutPath = path.resolve(workspacePath, 'checkout');
|
||||
const targetPath = path.resolve(workspacePath, 'template');
|
||||
|
||||
await preparer.prepare({
|
||||
url: `file:///${root}path/to/template`,
|
||||
@@ -37,12 +37,12 @@ describe('File preparer', () => {
|
||||
});
|
||||
expect(fs.copy).toHaveBeenCalledWith(
|
||||
path.join(root, 'path', 'to', 'template'),
|
||||
checkoutPath,
|
||||
targetPath,
|
||||
{
|
||||
recursive: true,
|
||||
},
|
||||
);
|
||||
expect(fs.ensureDir).toHaveBeenCalledWith(checkoutPath);
|
||||
expect(fs.ensureDir).toHaveBeenCalledWith(targetPath);
|
||||
|
||||
await expect(
|
||||
preparer.prepare({
|
||||
|
||||
@@ -25,12 +25,12 @@ export class FilePreparer implements PreparerBase {
|
||||
throw new InputError(`Wrong location protocol, should be 'file', ${url}`);
|
||||
}
|
||||
|
||||
const templateDir = path.join(workspacePath, 'template');
|
||||
await fs.ensureDir(templateDir);
|
||||
const targetDir = path.join(workspacePath, 'template');
|
||||
await fs.ensureDir(targetDir);
|
||||
|
||||
const templatePath = fileURLToPath(url);
|
||||
|
||||
await fs.copy(templatePath, templateDir, {
|
||||
await fs.copy(templatePath, targetDir, {
|
||||
recursive: true,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user