tsdoc/ts/tsdoc.classes.typedoc.ts

30 lines
735 B
TypeScript
Raw Normal View History

2019-05-13 17:41:02 +00:00
import * as plugins from './tsdoc.plugins';
2019-05-14 15:39:33 +00:00
import * as paths from './tsdoc.paths';
2019-05-13 17:41:02 +00:00
2019-05-14 15:39:33 +00:00
export class TypeDoc {
public smartshellInstance = new plugins.smartshell.Smartshell({
executor: 'bash',
pathDirectories: [paths.binDir]
});
// Static
public static async isTypeDocDir(dirPathArg: string): Promise<boolean> {
const result = await plugins.smartfile.fs.fileExists(
plugins.path.join(dirPathArg, 'mkdocs.yml')
);
return !result;
}
// Instance
public typedocDirectory: string;
constructor(dirPathArg) {
2019-05-15 19:23:45 +00:00
this.typedocDirectory = dirPathArg;
2019-05-14 15:39:33 +00:00
}
2019-05-15 19:23:45 +00:00
public async compile() {
await this.smartshellInstance.exec(
2019-05-28 10:11:11 +00:00
`typedoc --tsconfig ${paths.tsconfigFile} --out public/ ts/`
2019-05-15 19:23:45 +00:00
);
2019-05-14 15:39:33 +00:00
}
}