create-payload-app 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/lib/createProject.js +13 -6
- package/dist/main.js +1 -0
- package/package.json +1 -1
@@ -95,14 +95,20 @@ function installDeps(args, dir, packageManager) {
|
|
95
95
|
});
|
96
96
|
});
|
97
97
|
}
|
98
|
-
function getLatestPayloadVersion() {
|
98
|
+
function getLatestPayloadVersion(betaFlag) {
|
99
|
+
if (betaFlag === void 0) { betaFlag = false; }
|
99
100
|
return __awaiter(this, void 0, void 0, function () {
|
100
|
-
var stdout, error_2;
|
101
|
+
var packageWithTag, stdout, error_2;
|
101
102
|
return __generator(this, function (_a) {
|
102
103
|
switch (_a.label) {
|
103
104
|
case 0:
|
104
105
|
_a.trys.push([0, 2, , 3]);
|
105
|
-
|
106
|
+
packageWithTag = 'payload';
|
107
|
+
if (betaFlag)
|
108
|
+
packageWithTag += '@beta';
|
109
|
+
return [4 /*yield*/, execa_1.default("npm info " + packageWithTag + " version", [], {
|
110
|
+
shell: true,
|
111
|
+
})];
|
106
112
|
case 1:
|
107
113
|
stdout = (_a.sent()).stdout;
|
108
114
|
return [2 /*return*/, "^" + stdout];
|
@@ -115,12 +121,13 @@ function getLatestPayloadVersion() {
|
|
115
121
|
});
|
116
122
|
}
|
117
123
|
exports.getLatestPayloadVersion = getLatestPayloadVersion;
|
118
|
-
function updatePayloadVersion(projectDir) {
|
124
|
+
function updatePayloadVersion(projectDir, betaFlag) {
|
125
|
+
if (betaFlag === void 0) { betaFlag = false; }
|
119
126
|
return __awaiter(this, void 0, void 0, function () {
|
120
127
|
var payloadVersion, packageJsonPath, packageObj, err_1;
|
121
128
|
return __generator(this, function (_a) {
|
122
129
|
switch (_a.label) {
|
123
|
-
case 0: return [4 /*yield*/, getLatestPayloadVersion()];
|
130
|
+
case 0: return [4 /*yield*/, getLatestPayloadVersion(betaFlag)];
|
124
131
|
case 1:
|
125
132
|
payloadVersion = _a.sent();
|
126
133
|
if (!payloadVersion) {
|
@@ -181,7 +188,7 @@ function createProject(args, projectDir, template, packageManager) {
|
|
181
188
|
return [3 /*break*/, 6];
|
182
189
|
case 6:
|
183
190
|
spinner = ora_1.default('Checking latest Payload version...').start();
|
184
|
-
return [4 /*yield*/, updatePayloadVersion(projectDir)];
|
191
|
+
return [4 /*yield*/, updatePayloadVersion(projectDir, args['--beta'])];
|
185
192
|
case 7:
|
186
193
|
_a.sent();
|
187
194
|
spinner.text = 'Installing dependencies...';
|
package/dist/main.js
CHANGED