Skip to content

Commit 2cda1e6

Browse files
NathanWalkerrigor789
authored andcommitted
fix: runtime name/version parse
1 parent b66a3c0 commit 2cda1e6

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

lib/constants.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,8 @@ export const XcodeDeprecationStringFormat = "The current Xcode version %s will n
259259

260260
export const PROGRESS_PRIVACY_POLICY_URL = "https://www.progress.com/legal/privacy-policy";
261261
export class SubscribeForNewsletterMessages {
262-
public static AgreeToReceiveEmailMsg = "I agree".green.bold + " to receive email communications from Progress Software in the form of the NativeScript Newsletter. Consent may be withdrawn at any time.";
263-
public static ReviewPrivacyPolicyMsg = `You can review the Progress Software Privacy Policy at \`${PROGRESS_PRIVACY_POLICY_URL}\``;
262+
public static AgreeToReceiveEmailMsg = "I agree".green.bold + " to receive email communications in the form of the NativeScript Newsletter. Consent may be withdrawn at any time.";
263+
public static ReviewPrivacyPolicyMsg = `You can review the Privacy Policy at \`${PROGRESS_PRIVACY_POLICY_URL}\``;
264264
public static PromptMsg = "Input your e-mail address to agree".green + " or " + "leave empty to decline".red.bold + ":";
265265
}
266266

lib/services/platform/add-platform-service.ts

+13-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,19 @@ export class AddPlatformService implements IAddPlatformService {
3434
await this.setPlatformVersion(platformData, projectData, frameworkVersion);
3535
await this.trackPlatformVersion(frameworkVersion, platformData);
3636
} else {
37-
const [ name, version ] = packageToInstall.split('@');
37+
const parts = packageToInstall.split('@');
38+
let name: string;
39+
let version: string;
40+
if (parts.length > 2) {
41+
// scoped runtimes
42+
name = `@${parts[1]}`;
43+
version = parts[2];
44+
} else {
45+
// original tns-* runtimes
46+
name = parts[0];
47+
version = parts[1];
48+
}
49+
3850
frameworkDirPath = path.join(projectData.projectDir, 'node_modules', name, PROJECT_FRAMEWORK_FOLDER_NAME);
3951
frameworkVersion = version;
4052
if (!projectData.devDependencies) {

0 commit comments

Comments
 (0)