Expose new option in techdocs cli generate command

The re-assignment of container user on macOS/Linux is troublesome when running on rootless GitHub runners; adding a way to bypass this for generation.

This should be a non-breaking change and just adds functionality.

Signed-off-by: Kamil Zainal <gh@akza.dev>
This commit is contained in:
Kamil Zainal
2023-10-23 14:49:19 +01:00
parent 2357773c16
commit d15d483a49
7 changed files with 19 additions and 1 deletions
@@ -97,6 +97,7 @@ export class TechdocsGenerator implements GeneratorBase {
logger: childLogger,
logStream,
siteOptions,
runAsDefaultUser
} = options;
// Do some updates to mkdocs.yml before generating docs e.g. adding repo_url
@@ -171,6 +172,7 @@ export class TechdocsGenerator implements GeneratorBase {
// write to, otherwise they will just fail trying to write to /
envVars: { HOME: '/tmp' },
pullImage: this.options.pullImage,
defaultUser: runAsDefaultUser
});
childLogger.info(
`Successfully generated docs from ${inputDir} into ${outputDir} using techdocs-container`,
@@ -64,6 +64,7 @@ export type GeneratorRunOptions = {
logger: Logger;
logStream?: Writable;
siteOptions?: { name?: string };
runAsDefaultUser?: boolean;
};
/**