Fix catalog:write on windows systems

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2021-06-24 12:52:46 +02:00
parent 5c2550a6d4
commit 1627daac2b
3 changed files with 8 additions and 1 deletions
@@ -37,6 +37,7 @@ describe('catalog:write', () => {
output: jest.fn(),
createTemporaryDirectory: jest.fn(),
};
beforeEach(() => {
jest.resetAllMocks();
});
@@ -15,6 +15,7 @@
*/
import fs from 'fs-extra';
import { resolve as resolvePath } from 'path';
import { createTemplateAction } from '../../createTemplateAction';
import * as yaml from 'yaml';
import { Entity } from '@backstage/catalog-model';
@@ -41,7 +42,7 @@ export function createCatalogWriteAction() {
const { entity } = ctx.input;
await fs.writeFile(
`${ctx.workspacePath}/catalog-info.yaml`,
resolvePath(ctx.workspacePath, 'catalog-info.yaml'),
yaml.stringify(entity),
);
},