Skip to content

Commit

Permalink
feat: do not add pod-install if expo managed project [no issue] (#1107)
Browse files Browse the repository at this point in the history
  • Loading branch information
theohdv authored Nov 27, 2024
1 parent 6b31a84 commit 5dccb1f
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions @ornikar/repo-config/lib/postinstall/install-husky.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,16 @@ fi
}

const podfilePath = path.join(packageLocation, 'ios/Podfile.lock');

if (fs.existsSync(podfilePath)) {
postHookContent += `
if [ -n "$(git diff HEAD@{1}..HEAD@{0} -- ${podfilePath})" ]; then
${[cdToPackageLocation, 'yarn pod-install || true', cdToRoot].filter(Boolean).join('\n ')}
fi
`;
const gitIgnorePath = path.join(packageLocation, '.gitignore');
if (fs.existsSync(gitIgnorePath) && !fs.readFileSync(gitIgnorePath, 'utf8').includes('/ios/')) {
postHookContent += `
if [ -n "$(git diff HEAD@{1}..HEAD@{0} -- ${podfilePath})" ]; then
${[cdToPackageLocation, 'yarn pod-install || true', cdToRoot].filter(Boolean).join('\n ')}
fi
`;
}
}
});
writeHook('post-checkout', postHookContent);
Expand Down

0 comments on commit 5dccb1f

Please sign in to comment.