@hubspot/cli 7.5.2-experimental.0 → 7.5.3-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 +12 -10
- package/package.json +1 -1
package/lib/app/migrate.js
CHANGED
|
@@ -114,23 +114,20 @@ async function handleMigrationSetup(derivedAccountId, options, projectConfig) {
|
|
|
114
114
|
if (!proceed) {
|
|
115
115
|
return {};
|
|
116
116
|
}
|
|
117
|
-
const projectName = projectConfig?.projectConfig?.name ||
|
|
118
|
-
name ||
|
|
119
|
-
(await (0, promptUtils_1.inputPrompt)((0, lang_1.i18n)('commands.project.subcommands.migrateApp.prompt.inputName')));
|
|
120
|
-
const { projectExists } = await (0, projects_3.ensureProjectExists)(derivedAccountId, projectName, { allowCreate: false, noLogs: true });
|
|
121
117
|
// If it's a project we don't want to prompt for dest and name, so just return early
|
|
122
118
|
if (projectConfig &&
|
|
123
119
|
projectConfig?.projectConfig &&
|
|
124
120
|
projectConfig?.projectDir) {
|
|
125
|
-
if (!projectExists) {
|
|
126
|
-
throw new Error('The project you are trying to migrate does not exist');
|
|
127
|
-
}
|
|
128
121
|
return {
|
|
129
122
|
appIdToMigrate,
|
|
130
123
|
projectName: projectConfig.projectConfig.name,
|
|
131
124
|
projectDest: projectConfig.projectDir,
|
|
132
125
|
};
|
|
133
126
|
}
|
|
127
|
+
const projectName = projectConfig?.projectConfig?.name ||
|
|
128
|
+
name ||
|
|
129
|
+
(await (0, promptUtils_1.inputPrompt)((0, lang_1.i18n)('commands.project.subcommands.migrateApp.prompt.inputName')));
|
|
130
|
+
const { projectExists } = await (0, projects_3.ensureProjectExists)(derivedAccountId, projectName, { allowCreate: false, noLogs: true });
|
|
134
131
|
if (projectExists) {
|
|
135
132
|
throw new Error((0, lang_1.i18n)('commands.project.subcommands.migrateApp.errors.projectAlreadyExists', {
|
|
136
133
|
projectName,
|
|
@@ -254,10 +251,15 @@ async function downloadProjectFiles(derivedAccountId, projectName, buildId, proj
|
|
|
254
251
|
}
|
|
255
252
|
async function migrateApp2025_2(derivedAccountId, options, projectConfig) {
|
|
256
253
|
SpinniesManager_1.default.init();
|
|
257
|
-
if (projectConfig
|
|
258
|
-
(!projectConfig?.projectConfig || !projectConfig?.projectDir)
|
|
254
|
+
if (projectConfig) {
|
|
255
|
+
if (!projectConfig?.projectConfig || !projectConfig?.projectDir) {
|
|
256
|
+
throw new Error('Invalid project config');
|
|
257
|
+
}
|
|
259
258
|
// TODO: i18n
|
|
260
|
-
|
|
259
|
+
const { projectExists } = await (0, projects_3.ensureProjectExists)(derivedAccountId, projectConfig.projectConfig.name, { allowCreate: false, noLogs: true });
|
|
260
|
+
if (!projectExists) {
|
|
261
|
+
throw new Error('Project does not exist, unable to migrate');
|
|
262
|
+
}
|
|
261
263
|
}
|
|
262
264
|
const { appIdToMigrate, projectName, projectDest } = await handleMigrationSetup(derivedAccountId, options, projectConfig);
|
|
263
265
|
if (!appIdToMigrate || !projectName || !projectDest) {
|
package/package.json
CHANGED