tsdoc/ts/tsdoc.classes.typedoc.ts

31 lines
771 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() {
2019-05-19 19:48:54 +00:00
console.log(paths.binDir);
2019-05-15 19:23:45 +00:00
await this.smartshellInstance.exec(
`typedoc --module "commonjs" --target "ES2016" --out public/ ts/`
);
2019-05-14 15:39:33 +00:00
}
}