create-payload-app 0.3.10 → 0.3.11
Sign up to get free protection for your applications and to get access to all the features.
@@ -159,7 +159,7 @@ function updatePayloadVersion(projectDir, betaFlag) {
|
|
159
159
|
exports.updatePayloadVersion = updatePayloadVersion;
|
160
160
|
function createProject(args, projectDir, template, packageManager) {
|
161
161
|
return __awaiter(this, void 0, void 0, function () {
|
162
|
-
var templateDir, emitter, err_2, msg, spinner, result;
|
162
|
+
var templateDir, emitter, src, dest, err_2, msg, spinner, result;
|
163
163
|
return __generator(this, function (_a) {
|
164
164
|
switch (_a.label) {
|
165
165
|
case 0: return [4 /*yield*/, createProjectDir(projectDir)];
|
@@ -172,28 +172,36 @@ function createProject(args, projectDir, template, packageManager) {
|
|
172
172
|
return [4 /*yield*/, emitter.clone(projectDir)];
|
173
173
|
case 2:
|
174
174
|
_a.sent();
|
175
|
-
return [3 /*break*/,
|
175
|
+
return [3 /*break*/, 8];
|
176
176
|
case 3:
|
177
|
-
_a.trys.push([3,
|
177
|
+
_a.trys.push([3, 7, , 8]);
|
178
178
|
return [4 /*yield*/, fs_extra_1.default.copy(templateDir, projectDir, { recursive: true })];
|
179
179
|
case 4:
|
180
180
|
_a.sent();
|
181
|
-
|
182
|
-
|
181
|
+
if (!(packageManager === 'npm')) return [3 /*break*/, 6];
|
182
|
+
src = path_1.default.resolve(templateDir, '..', 'npmrc.template');
|
183
|
+
dest = path_1.default.resolve(projectDir, '.npmrc');
|
184
|
+
return [4 /*yield*/, fs_extra_1.default.copy(src, dest)];
|
183
185
|
case 5:
|
186
|
+
_a.sent();
|
187
|
+
_a.label = 6;
|
188
|
+
case 6:
|
189
|
+
(0, log_1.success)('Project directory created');
|
190
|
+
return [3 /*break*/, 8];
|
191
|
+
case 7:
|
184
192
|
err_2 = _a.sent();
|
185
193
|
msg = 'Unable to copy template files. Please check template name or directory permissions.';
|
186
194
|
(0, log_1.error)(msg);
|
187
195
|
process.exit(1);
|
188
|
-
return [3 /*break*/,
|
189
|
-
case
|
196
|
+
return [3 /*break*/, 8];
|
197
|
+
case 8:
|
190
198
|
spinner = (0, ora_1.default)('Checking latest Payload version...').start();
|
191
199
|
return [4 /*yield*/, updatePayloadVersion(projectDir, args['--beta'])];
|
192
|
-
case
|
200
|
+
case 9:
|
193
201
|
_a.sent();
|
194
202
|
spinner.text = 'Installing dependencies...';
|
195
203
|
return [4 /*yield*/, installDeps(args, projectDir, packageManager)];
|
196
|
-
case
|
204
|
+
case 10:
|
197
205
|
result = _a.sent();
|
198
206
|
spinner.stop();
|
199
207
|
spinner.clear();
|
@@ -0,0 +1 @@
|
|
1
|
+
legacy-peer-deps=true
|