Skip to content

Commit b7fb5e4

Browse files
committed
fix: update the error message shown when the app is not migrated and the message shown at the end of migrate command
1 parent 40e5bc3 commit b7fb5e4

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

lib/controllers/migrate-controller.ts

+8-5
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@ import { UpdateControllerBase } from "./update-controller-base";
66
import { fromWindowsRelativePathToUnix } from "../common/helpers";
77

88
export class MigrateController extends UpdateControllerBase implements IMigrateController {
9-
// TODO: Improve the messages here
10-
public UNABLE_TO_MIGRATE_APP_ERROR = "The project is not compatible with NativeScript 6.0";
11-
public MIGRATE_MESSAGE = "";
9+
// TODO: Update the links to blog post when it is available
10+
private static UNABLE_TO_MIGRATE_APP_ERROR = `The current application is not compatible with NativeScript CLI 6.0.
11+
Use the \`tns migrate\` command to migrate the app dependencies to a form compatible with NativeScript 6.0.
12+
Running this command will not affect the codebase of the application and you might need to do additional changes manually –
13+
for more information, refer to the instructions in the following blog post: <link to blog post>.`;
14+
private static MIGRATE_FINISH_MESSAGE = "The `tns migrate` command does not affect the codebase of the application and you might need to do additional changes manually – for more information, refer to the instructions in the following blog post: <link to blog post>.";
1215

1316
constructor(
1417
protected $fs: IFileSystem,
@@ -120,7 +123,7 @@ export class MigrateController extends UpdateControllerBase implements IMigrateC
120123
this.$errors.failWithoutHelp(`${MigrateController.migrateFailMessage} The error is: ${error}`);
121124
}
122125

123-
this.$logger.info(this.MIGRATE_MESSAGE);
126+
this.$logger.info(MigrateController.MIGRATE_FINISH_MESSAGE);
124127
}
125128

126129
public async shouldMigrate({ projectDir }: IProjectDir): Promise<boolean> {
@@ -162,7 +165,7 @@ export class MigrateController extends UpdateControllerBase implements IMigrateC
162165
public async validate({ projectDir }: IProjectDir): Promise<void> {
163166
const shouldMigrate = await this.shouldMigrate({ projectDir });
164167
if (shouldMigrate) {
165-
this.$errors.failWithoutHelp(this.UNABLE_TO_MIGRATE_APP_ERROR);
168+
this.$errors.failWithoutHelp(MigrateController.UNABLE_TO_MIGRATE_APP_ERROR);
166169
}
167170
}
168171

0 commit comments

Comments
 (0)