1. Use plain Record instead of Map

2. Call fs.realpath inside the utility function

Signed-off-by: Himanshu Mishra <himanshu@orkohunter.net>
This commit is contained in:
Himanshu Mishra
2021-03-08 12:44:11 +01:00
parent 29b64038e1
commit c0c26244db
6 changed files with 34 additions and 35 deletions
@@ -16,7 +16,6 @@
import { runDockerContainer } from '@backstage/backend-common';
import { Config } from '@backstage/config';
import fs from 'fs-extra';
import path from 'path';
import { PassThrough } from 'stream';
import { Logger } from 'winston';
@@ -80,12 +79,10 @@ export class TechdocsGenerator implements GeneratorBase {
}
// Directories to bind on container
const mountDirs = new Map([
// Need to use realpath here as Docker mounting does not like
// symlinks for binding volumes
[await fs.realpath(inputDir), '/input'],
[await fs.realpath(outputDir), '/output'],
]);
const mountDirs = {
[inputDir]: '/input',
[outputDir]: '/output',
};
try {
switch (this.options.runGeneratorIn) {