-
-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathconvertAbout.ts
More file actions
36 lines (34 loc) · 1.03 KB
/
convertAbout.ts
File metadata and controls
36 lines (34 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { copyFile } from 'fs';
import path from 'path';
import { Task, TaskOutput } from './Task';
export interface AboutTaskOutput extends TaskOutput {
taskName: 'ConvertAbout';
}
/**
* Copies about.partial.html to static folder
*/
export function convertAbout(dataDir: string, verbose: number) {
const srcFile = path.join(dataDir, 'about.partial.html');
const dstFile = path.join('src/gen-assets', 'about.partial.html');
copyFile(srcFile, dstFile, function (err: any) {
if (err) {
throw err;
}
if (verbose) {
console.log(`copied ${srcFile} to ${dstFile}`);
}
});
}
export class ConvertAbout extends Task {
public triggerFiles: string[] = ['about.partial.html'];
constructor(dataDir: string) {
super(dataDir);
}
public async run(verbose: number, outputs: Map<string, TaskOutput>): Promise<TaskOutput> {
convertAbout(this.dataDir, verbose);
return {
taskName: this.constructor.name,
files: []
};
}
}