create-uix-app 1.2.0 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +1 -1
- package/src/index.js +19 -13
package/package.json
CHANGED
package/src/index.js
CHANGED
@@ -40,35 +40,41 @@ if (!projectName) {
|
|
40
40
|
.then(
|
41
41
|
(r) =>
|
42
42
|
new Promise((resolve, reject) => {
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
43
|
+
r.data
|
44
|
+
.pipe(tar.extract({ cwd: process.cwd() }))
|
45
|
+
.on("end", () => {
|
46
|
+
fs.renameSync(
|
47
|
+
path.join(
|
48
|
+
process.cwd(),
|
49
|
+
reFrame ? "uix-starter-re-frame" : "uix-starter-main"
|
50
|
+
),
|
51
|
+
path.join(process.cwd(), projectName)
|
52
|
+
);
|
53
|
+
resolve();
|
51
54
|
})
|
52
|
-
|
55
|
+
.on("error", (err) => reject(err));
|
53
56
|
})
|
54
57
|
)
|
55
58
|
.then(() => {
|
56
59
|
const pkgjson = JSON.parse(
|
57
|
-
fs.readFileSync(
|
60
|
+
fs.readFileSync(
|
61
|
+
path.join(process.cwd(), projectName, "package.json"),
|
62
|
+
"utf8"
|
63
|
+
)
|
58
64
|
);
|
59
65
|
pkgjson.name = projectName;
|
60
66
|
fs.writeFileSync(
|
61
|
-
path.join(projectName, "package.json"),
|
67
|
+
path.join(process.cwd(), projectName, "package.json"),
|
62
68
|
prettier.format(JSON.stringify(pkgjson), {
|
63
69
|
parser: "json",
|
64
70
|
})
|
65
71
|
);
|
66
72
|
const readme = fs.readFileSync(
|
67
|
-
path.join(projectName, "README.md"),
|
73
|
+
path.join(process.cwd(), projectName, "README.md"),
|
68
74
|
"utf8"
|
69
75
|
);
|
70
76
|
fs.writeFileSync(
|
71
|
-
path.join(projectName, "README.md"),
|
77
|
+
path.join(process.cwd(), projectName, "README.md"),
|
72
78
|
readme
|
73
79
|
.replace("uix-starter", projectName)
|
74
80
|
.split("\n")
|