-
Notifications
You must be signed in to change notification settings - Fork 0
/
angularProj.ts
40 lines (34 loc) · 1.03 KB
/
angularProj.ts
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
37
38
39
40
import { BaseProj } from "./baseProj";
import { Questions } from "inquirer";
import * as path from "path";
import { unzipPath } from "zip-i/es";
import { GlobalData } from "../../../model/globalData";
import { editPackageJson } from "../../../common/util";
import { TemplateData } from "../../../common/template";
export class AngularProj extends BaseProj {
getQuestions() {
let questionList: Questions[] = [
{
name: "antDesign",
type: "list",
message: "是否引入Ant Design",
default: "是",
choices: ["是", "否"]
}
];
return questionList;
}
async run() {
let answer = await this.getAnswers();
let templateZipFile = TemplateData.getProjectTemplate("angular.zip");
await unzipPath(templateZipFile, GlobalData.projectRootPath);
await this.addAntDesign();
}
private async addAntDesign() {
await editPackageJson(GlobalData.projectRootPath, json => {
Object.assign(json.devDependencies, {
"ng-zorro-antd": "^0.6.8"
});
});
}
}