File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
packages/@ionic/cli/src/lib/integrations/capacitor Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -195,9 +195,16 @@ export class Integration extends BaseIntegration<ProjectIntegration> {
195195 if ( ! output ) {
196196 debug ( 'Could not get config from Capacitor CLI (probably old version)' ) ;
197197 return ;
198+ } else {
199+ try {
200+ // Capacitor 1 returns the `command not found` error in stdout instead of stderror like in Capacitor 2
201+ // This ensures that the output from the command is valid JSON to account for this
202+ return JSON . parse ( output ) ;
203+ } catch ( e ) {
204+ debug ( 'Could not get config from Capacitor CLI (probably old version)' , e ) ;
205+ return ;
206+ }
198207 }
199-
200- return JSON . parse ( output ) ;
201208 } ) ;
202209
203210 getCapacitorConfig = lodash . memoize ( async ( ) : Promise < CapacitorConfig | undefined > => {
You can’t perform that action at this time.
0 commit comments