Skip to content

Commit fb4c651

Browse files
committed
chore: changes from review
1 parent ba423e6 commit fb4c651

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

plugin/src/helpers/files.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export const patchFile = async (baseDir): Promise<void> => {
5252
/**
5353
* Given an array of base paths and candidate modules, return the first one that exists
5454
*/
55-
export const findModuleFromBase = ({ paths, candidates }) => {
55+
export const findModuleFromBase = ({ paths, candidates }): string | null => {
5656
for (const candidate of candidates) {
5757
try {
5858
const modulePath = require.resolve(candidate, { paths })
@@ -73,8 +73,9 @@ export const findModuleFromBase = ({ paths, candidates }) => {
7373
*/
7474

7575
// eslint-disable-next-line complexity, max-statements
76-
export const relocateBinaries = async (baseDir: string) => {
76+
export const relocateBinaries = async (baseDir: string): Promise<void> => {
7777
if (process.env.NETLIFY_LOCAL) {
78+
// We currently only handle CI builds
7879
return
7980
}
8081
const currentAbi = process.versions.modules
@@ -85,7 +86,8 @@ export const relocateBinaries = async (baseDir: string) => {
8586
currentArch === DEFAULT_LAMBDA_ARCH &&
8687
currentPlatform === DEFAULT_LAMBDA_PLATFORM
8788
) {
88-
return true
89+
// No need to relocate
90+
return
8991
}
9092

9193
const gatsbyPath = findModuleFromBase({
@@ -95,7 +97,7 @@ export const relocateBinaries = async (baseDir: string) => {
9597

9698
if (!gatsbyPath) {
9799
console.error(`Could not find gatsby module in ${baseDir}`)
98-
return false
100+
return
99101
}
100102

101103
const lmdbPath = findModuleFromBase({

0 commit comments

Comments
 (0)