Skip to content

Commit ccd7ec2

Browse files
Include custom platform template when using tns init
When the `tns-<platform>` key in the package.json of nativescript project has custom template the template key must be kept and the version key should be added. When the --framework-name and --framework-version are passed as arguments.
1 parent 2496937 commit ccd7ec2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/services/init-service.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ export class InitService implements IInitService {
4747
projectData[this.$staticConfig.CLIENT_NAME_KEY_IN_PROJECT_FILE]["id"] = this.getProjectId().wait();
4848

4949
if (this.$options.frameworkName && this.$options.frameworkVersion) {
50-
projectData[this.$staticConfig.CLIENT_NAME_KEY_IN_PROJECT_FILE][this.$options.frameworkName] = this.buildVersionData(this.$options.frameworkVersion);
50+
let currentPlatformData = projectData[this.$staticConfig.CLIENT_NAME_KEY_IN_PROJECT_FILE][this.$options.frameworkName] || {};
51+
52+
projectData[this.$staticConfig.CLIENT_NAME_KEY_IN_PROJECT_FILE][this.$options.frameworkName] = _.extend(currentPlatformData, this.buildVersionData(this.$options.frameworkVersion));
5153
} else {
5254
let $platformsData = this.$injector.resolve("platformsData");
5355
_.each($platformsData.platformsNames, platform => {

0 commit comments

Comments
 (0)