Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion commands/app/migrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ import { i18n } from '../../lib/lang';
import { ApiErrorContext, logError } from '../../lib/errorHandlers';
import { EXIT_CODES } from '../../lib/enums/exitCodes';
import { migrateApp2025_2, MigrateAppArgs } from '../../lib/app/migrate';
import { uiBetaTag, uiLink } from '../../lib/ui';
import { uiBetaTag, uiCommandReference, uiLink } from '../../lib/ui';
import { migrateApp2023_2 } from '../../lib/app/migrate_legacy';
import { getIsInProject } from '../../lib/projects';

const { v2023_2, v2025_2, unstable } = PLATFORM_VERSIONS;
export const validMigrationTargets = [v2023_2, v2025_2, unstable];
Expand Down Expand Up @@ -54,6 +55,16 @@ export async function handler(options: ArgumentsCamelCase<MigrateAppArgs>) {

try {
if (platformVersion === v2025_2 || platformVersion === unstable) {
if (getIsInProject()) {
logger.error(
i18n(
`commands.project.subcommands.migrateApp.errors.notAllowedWithinProject`,
{ command: uiCommandReference('hs project migrate') }
)
);
process.exit(EXIT_CODES.ERROR);
}

await migrateApp2025_2(derivedAccountId, options);
} else {
await migrateApp2023_2(derivedAccountId, options, accountConfig);
Expand Down
1 change: 1 addition & 0 deletions lang/en.lyaml
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,7 @@ en:
projectAlreadyExists: "A project with name {{ projectName }} already exists. Please choose another name."
invalidApp: "Could not migrate appId {{ appId }}. This app cannot be migrated at this time. Please choose another public app."
migrationFailed: 'Migration Failed'
notAllowedWithinProject: 'This command cannot be run from within a project directory. Run the command again from outside a project directory. If you are trying to migrate a project, run {{ command }}'
cloneApp:
describe: "Clone a public app using the projects framework."
examples:
Expand Down
2 changes: 2 additions & 0 deletions lang/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -994,6 +994,8 @@ export const commands = {
`Could not migrate appId ${appId}. This app cannot be migrated at this time. Please choose another public app.`,
appWithAppIdNotFound: appId =>
`Could not find an app with the id ${appId} `,
notAllowedWithinProject: command =>
`This command cannot be run from within a project directory. Run the command again from outside a project directory. If you are trying to migrate a project, run ${command}`,
},
},
cloneApp: {
Expand Down