@hubspot/cli 7.4.1-experimental.0 → 7.4.2-experimental.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/app/migrate.js +25 -5
- package/package.json +1 -1
package/lib/app/migrate.js
CHANGED
|
@@ -31,6 +31,7 @@ const chalk_1 = __importDefault(require("chalk"));
|
|
|
31
31
|
const project_parsing_lib_1 = require("@hubspot/project-parsing-lib");
|
|
32
32
|
const projects_3 = require("@hubspot/local-dev-lib/constants/projects");
|
|
33
33
|
const transform_1 = require("@hubspot/project-parsing-lib/src/lib/transform");
|
|
34
|
+
const index_1 = require("@hubspot/local-dev-lib/errors/index");
|
|
34
35
|
function getUnmigratableReason(reasonCode) {
|
|
35
36
|
switch (reasonCode) {
|
|
36
37
|
case projects_3.UNMIGRATABLE_REASONS.UP_TO_DATE:
|
|
@@ -273,15 +274,34 @@ async function migrateApp2023_2(derivedAccountId, options, accountConfig) {
|
|
|
273
274
|
}
|
|
274
275
|
const createProjectPromptResponse = await (0, createProjectPrompt_1.createProjectPrompt)(options);
|
|
275
276
|
const { name: projectName, dest: projectDest } = createProjectPromptResponse;
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
noLogs: true,
|
|
279
|
-
});
|
|
280
|
-
if (projectExists) {
|
|
277
|
+
try {
|
|
278
|
+
await (0, projects_2.fetchProject)(derivedAccountId, projectName);
|
|
281
279
|
throw new Error((0, lang_1.i18n)(`${i18nKey}.errors.projectAlreadyExists`, {
|
|
282
280
|
projectName,
|
|
283
281
|
}));
|
|
284
282
|
}
|
|
283
|
+
catch (error) {
|
|
284
|
+
if (!(0, index_1.isSpecifiedError)(error, { statusCode: 404 })) {
|
|
285
|
+
(0, errorHandlers_1.logError)(error, new errorHandlers_1.ApiErrorContext({ accountId: derivedAccountId }));
|
|
286
|
+
return process.exit(exitCodes_1.EXIT_CODES.ERROR);
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
// const { projectExists } = await ensureProjectExists(
|
|
290
|
+
// derivedAccountId,
|
|
291
|
+
// projectName,
|
|
292
|
+
// {
|
|
293
|
+
// allowCreate: false,
|
|
294
|
+
// noLogs: true,
|
|
295
|
+
// }
|
|
296
|
+
// );
|
|
297
|
+
//
|
|
298
|
+
// if (projectExists) {
|
|
299
|
+
// throw new Error(
|
|
300
|
+
// i18n(`${i18nKey}.errors.projectAlreadyExists`, {
|
|
301
|
+
// projectName,
|
|
302
|
+
// })
|
|
303
|
+
// );
|
|
304
|
+
// }
|
|
285
305
|
await (0, usageTracking_1.trackCommandMetadataUsage)('migrate-app', { step: 'STARTED' }, derivedAccountId);
|
|
286
306
|
logger_1.logger.log('');
|
|
287
307
|
(0, ui_1.uiLine)();
|
package/package.json
CHANGED