Skip to content

Commit

Permalink
fix: runtime name/version parse
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanWalker authored and rigor789 committed Sep 4, 2020
1 parent b66a3c0 commit 2cda1e6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,8 @@ export const XcodeDeprecationStringFormat = "The current Xcode version %s will n

export const PROGRESS_PRIVACY_POLICY_URL = "https://www.progress.com/legal/privacy-policy";
export class SubscribeForNewsletterMessages {
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.";
public static ReviewPrivacyPolicyMsg = `You can review the Progress Software Privacy Policy at \`${PROGRESS_PRIVACY_POLICY_URL}\``;
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.";
public static ReviewPrivacyPolicyMsg = `You can review the Privacy Policy at \`${PROGRESS_PRIVACY_POLICY_URL}\``;
public static PromptMsg = "Input your e-mail address to agree".green + " or " + "leave empty to decline".red.bold + ":";
}

Expand Down
14 changes: 13 additions & 1 deletion lib/services/platform/add-platform-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,19 @@ export class AddPlatformService implements IAddPlatformService {
await this.setPlatformVersion(platformData, projectData, frameworkVersion);
await this.trackPlatformVersion(frameworkVersion, platformData);
} else {
const [ name, version ] = packageToInstall.split('@');
const parts = packageToInstall.split('@');
let name: string;
let version: string;
if (parts.length > 2) {
// scoped runtimes
name = `@${parts[1]}`;
version = parts[2];
} else {
// original tns-* runtimes
name = parts[0];
version = parts[1];
}

frameworkDirPath = path.join(projectData.projectDir, 'node_modules', name, PROJECT_FRAMEWORK_FOLDER_NAME);
frameworkVersion = version;
if (!projectData.devDependencies) {
Expand Down

0 comments on commit 2cda1e6

Please sign in to comment.