bug: fixing the input path to the FilePreparer, and fixing the destination directory for the preparer to template

This commit is contained in:
blam
2021-02-12 22:48:57 +01:00
parent 1aa1d74f73
commit d84df12d3b
2 changed files with 5 additions and 5 deletions
@@ -25,12 +25,12 @@ export class FilePreparer implements PreparerBase {
throw new InputError(`Wrong location protocol, should be 'file', ${url}`);
}
const checkoutDir = path.join(workspacePath, 'checkout');
await fs.ensureDir(checkoutDir);
const templateDir = path.join(workspacePath, 'template');
await fs.ensureDir(templateDir);
const templatePath = fileURLToPath(url);
await fs.copy(templatePath, checkoutDir, {
await fs.copy(templatePath, templateDir, {
recursive: true,
});
}
@@ -17,7 +17,7 @@
import { Config } from '@backstage/config';
import Docker from 'dockerode';
import express from 'express';
import { resolve as resolvePath } from 'path';
import { resolve as resolvePath, dirname } from 'path';
import Router from 'express-promise-router';
import { Logger } from 'winston';
import {
@@ -164,7 +164,7 @@ export async function createRouter(
const preparer = new FilePreparer();
const path = resolvePath(
templateEntityLocation,
dirname(templateEntityLocation),
template.spec.path || '.',
);