Skip to content

Commit b64d3f9

Browse files
committed
Fix defaulting type errors
1 parent 37624e0 commit b64d3f9

File tree

2 files changed

+13
-3
lines changed
  • packages/react-native/scripts/codegen/generate-artifacts-executor

2 files changed

+13
-3
lines changed

packages/react-native/scripts/codegen/generate-artifacts-executor/index.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,18 @@ function computeOutputPath(
229229
return baseOutputPath;
230230
}
231231
if (platform === 'android') {
232-
return defaultOutputPathForAndroid(baseOutputPath);
232+
return defaultOutputPathForAndroid(
233+
baseOutputPath != null && baseOutputPath.length > 0
234+
? baseOutputPath
235+
: projectRoot,
236+
);
233237
}
234238
if (platform === 'ios') {
235-
return defaultOutputPathForIOS(baseOutputPath);
239+
return defaultOutputPathForIOS(
240+
baseOutputPath != null && baseOutputPath.length > 0
241+
? baseOutputPath
242+
: projectRoot,
243+
);
236244
}
237245
return baseOutputPath;
238246
}

packages/react-native/scripts/codegen/generate-artifacts-executor/utils.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,9 @@ function readGeneratedAutolinkingOutput(
104104
// NOTE: Generated by scripts/cocoapods/autolinking.rb in list_native_modules (called by use_native_modules)
105105
// The `baseOutputPath` is based on a CLI argument and optional
106106
const autolinkingGeneratedPath = path.resolve(
107-
baseOutputPath || projectRoot,
107+
baseOutputPath != null && baseOutputPath.length > 0
108+
? baseOutputPath
109+
: projectRoot,
108110
'build/generated/autolinking/autolinking.json',
109111
);
110112
if (fs.existsSync(autolinkingGeneratedPath)) {

0 commit comments

Comments
 (0)