@@ -52,7 +52,7 @@ export const patchFile = async (baseDir): Promise<void> => {
52
52
/**
53
53
* Given an array of base paths and candidate modules, return the first one that exists
54
54
*/
55
- export const findModuleFromBase = ( { paths, candidates } ) => {
55
+ export const findModuleFromBase = ( { paths, candidates } ) : string | null => {
56
56
for ( const candidate of candidates ) {
57
57
try {
58
58
const modulePath = require . resolve ( candidate , { paths } )
@@ -73,8 +73,9 @@ export const findModuleFromBase = ({ paths, candidates }) => {
73
73
*/
74
74
75
75
// eslint-disable-next-line complexity, max-statements
76
- export const relocateBinaries = async ( baseDir : string ) => {
76
+ export const relocateBinaries = async ( baseDir : string ) : Promise < void > => {
77
77
if ( process . env . NETLIFY_LOCAL ) {
78
+ // We currently only handle CI builds
78
79
return
79
80
}
80
81
const currentAbi = process . versions . modules
@@ -85,7 +86,8 @@ export const relocateBinaries = async (baseDir: string) => {
85
86
currentArch === DEFAULT_LAMBDA_ARCH &&
86
87
currentPlatform === DEFAULT_LAMBDA_PLATFORM
87
88
) {
88
- return true
89
+ // No need to relocate
90
+ return
89
91
}
90
92
91
93
const gatsbyPath = findModuleFromBase ( {
@@ -95,7 +97,7 @@ export const relocateBinaries = async (baseDir: string) => {
95
97
96
98
if ( ! gatsbyPath ) {
97
99
console . error ( `Could not find gatsby module in ${ baseDir } ` )
98
- return false
100
+ return
99
101
}
100
102
101
103
const lmdbPath = findModuleFromBase ( {
0 commit comments