Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Force --platform ios to be ios (not iphone) #672

Merged
merged 2 commits into from
Aug 1, 2024
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@

7.1.2 (7/31/2024)
-------------------
* fix: Force `--platform` to `ios`; the SDK converts `ios` to `iphone`, but
the CLI needs to reverse this to be able to look up the platform config

7.1.1 (7/30/2024)
-------------------
* fix: Rename platform config `iphone` to `ios` to align with
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "titanium",
"version": "7.1.1",
"version": "7.1.2",
"author": "TiDev, Inc. <npm@tidev.io>",
"description": "Command line interface for building Titanium SDK apps",
"type": "module",
Expand Down
8 changes: 8 additions & 0 deletions src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,13 @@ export class CLI {
return;
}

// when specifying `--platform ios`, the SDK's option callback converts
// it to `iphone`, however the platform config uses `ios` and we must
// convert it back
if (this.argv.platform === 'iphone') {
this.argv.platform = 'ios';
}

this.debugLogger.trace(`Processing --platform option: ${this.argv.platform || 'not specified'}`);
try {
if (!this.argv.platform) {
Expand Down Expand Up @@ -681,6 +688,7 @@ export class CLI {
const platformConf = this.command.conf.platforms[this.argv.platform];

this.argv.$platform = this.argv.platform;
// set the platform in Commander so we don't lose it when we re-parse the args
this.command.setOptionValue('platform', this.argv.platform);

// set platform context
Expand Down
Loading