bug: fixing the input path to the FilePreparer, and fixing the destination directory for the preparer to template
This commit is contained in:
@@ -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 || '.',
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user