fix(core): update
This commit is contained in:
parent
4e1721e909
commit
dd3c4860a0
@ -1,10 +1,32 @@
|
|||||||
import * as plugins from './tsdoc.plugins';
|
import * as plugins from './tsdoc.plugins';
|
||||||
|
import * as paths from './tsdoc.paths';
|
||||||
|
|
||||||
export class MkDocs {
|
export class MkDocs {
|
||||||
|
public smartshellInstance = new plugins.smartshell.Smartshell({
|
||||||
|
executor: 'bash',
|
||||||
|
pathDirectories: [paths.binDir]
|
||||||
|
});
|
||||||
|
|
||||||
public static async isMkDocsDir(dirPathArg: string): Promise<boolean> {
|
public static async isMkDocsDir(dirPathArg: string): Promise<boolean> {
|
||||||
const result = await plugins.smartfile.fs.fileExists(
|
const result = await plugins.smartfile.fs.fileExists(
|
||||||
plugins.path.join(dirPathArg, 'mkdocs.yml')
|
plugins.path.join(dirPathArg, 'mkdocs.yml')
|
||||||
);
|
);
|
||||||
return !result;
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Instance
|
||||||
|
public typedocDirectory: string;
|
||||||
|
constructor(dirPathArg) {
|
||||||
|
this.typedocDirectory = dirPathArg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async compile () {
|
||||||
|
await this.smartshellInstance.exec(`rm -rf public/`);
|
||||||
|
await this.smartshellInstance.exec(`docker run --rm -it -p 8000:8000 -v ${paths.cwd}:/docs mkdocs build`);
|
||||||
|
await this.smartshellInstance.exec(`gitzone commit`);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async serve () {
|
||||||
|
await this.smartshellInstance.exec(`docker run --rm -it -p 8000:8000 -v ${paths.cwd}:/docs registry.gitlab.com/hosttoday/ht-docker-mkdocs`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user