Skip to content

Commit f5f75fa

Browse files
Cybertron01ZIT-MikeSjcesarmobile
authored
fix(capacitor): forward --inline to Capacitor CLI on copy and sync (#4928)
Co-authored-by: Mike Summerfeldt <20338451+IT-MikeS@users.noreply.github.com> Co-authored-by: jcesarmobile <jcesarmobile@gmail.com>
1 parent 6fcf882 commit f5f75fa

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

packages/@ionic/cli/src/commands/capacitor/copy.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { CommandInstanceInfo, CommandLineInputs, CommandLineOptions, CommandMeta
44
import { input } from '../../lib/color';
55

66
import { CapacitorCommand } from './base';
7+
import * as semver from "semver";
78

89
export class CopyCommand extends CapacitorCommand implements CommandPreRun {
910
async getMetadata(): Promise<CommandMetadata> {
@@ -14,6 +15,12 @@ export class CopyCommand extends CapacitorCommand implements CommandPreRun {
1415
type: Boolean,
1516
default: true,
1617
},
18+
{
19+
name: 'inline',
20+
summary: 'Use inline source maps (only available on capacitor 4.2.0+)',
21+
type: Boolean,
22+
default: false
23+
}
1724
];
1825

1926
const runner = this.project && await this.project.getBuildRunner();
@@ -59,6 +66,11 @@ ${input('ionic capacitor copy')} will do the following:
5966

6067
const args = ['copy'];
6168

69+
const capVersion = await this.getCapacitorVersion();
70+
if(semver.gte(capVersion, "4.2.0") && options.inline) {
71+
args.push("--inline")
72+
}
73+
6274
if (platform) {
6375
args.push(platform);
6476
}

packages/@ionic/cli/src/commands/capacitor/sync.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { FatalException } from '../../lib/errors';
66
import { Hook, HookDeps } from '../../lib/hooks';
77

88
import { CapacitorCommand } from './base';
9+
import * as semver from 'semver';
910

1011
export class SyncCommand extends CapacitorCommand implements CommandPreRun {
1112
async getMetadata(): Promise<CommandMetadata> {
@@ -16,6 +17,12 @@ export class SyncCommand extends CapacitorCommand implements CommandPreRun {
1617
type: Boolean,
1718
default: true,
1819
},
20+
{
21+
name: 'inline',
22+
summary: 'Use inline source maps (only available on capacitor 4.1.0+)',
23+
type: Boolean,
24+
default: false
25+
}
1926
];
2027

2128
const runner = this.project && await this.project.getBuildRunner();
@@ -67,6 +74,11 @@ ${input('ionic capacitor sync')} will do the following:
6774

6875
const args = ['sync'];
6976

77+
const capVersion = await this.getCapacitorVersion();
78+
if(semver.gte(capVersion, "4.1.0") && options.inline) {
79+
args.push("--inline")
80+
}
81+
7082
if (platform) {
7183
args.push(platform);
7284
}

0 commit comments

Comments
 (0)