TechDocs: Tell users when index.md is missing (better error message) (#3429)

* TechDocs: Logger already prints the name of plugin

* TechDocs: Display a custom error message if provided

* TechDocs: throw custom error message if index.md is not present

* Language improvements. Thanks @freben

Co-authored-by: Fredrik Adelöw <freben@gmail.com>

Co-authored-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Himanshu Mishra
2020-11-25 09:52:19 +01:00
committed by GitHub
parent a7974a6769
commit 8fd5e64351
5 changed files with 30 additions and 8 deletions
@@ -53,9 +53,7 @@ export class LocalPublish implements PublisherBase {
);
if (!fs.existsSync(publishDir)) {
this.logger.info(
`[TechDocs]: Could not find ${publishDir}, creates the directory.`,
);
this.logger.info(`Could not find ${publishDir}, creating the directory.`);
fs.mkdirSync(publishDir, { recursive: true });
}
@@ -63,7 +61,7 @@ export class LocalPublish implements PublisherBase {
fs.copy(directory, publishDir, err => {
if (err) {
this.logger.debug(
`[TechDocs]: Failed to copy docs from ${directory} to ${publishDir}`,
`Failed to copy docs from ${directory} to ${publishDir}`,
);
reject(err);
}