Don't install Ruby or Python dependencies unnecessarily (#7084)

* Don't install Ruby or Python dependencies unnecessarily

* Less repeated code

* Cleaner code
This commit is contained in:
Leo Lamprecht
2021-11-30 14:36:27 +01:00
committed by GitHub
parent edb5eead81
commit abd9f019f1
5 changed files with 47 additions and 11 deletions

View File

@@ -61,6 +61,14 @@ function getRubyPath(meta: Meta, gemfileContents: string) {
// process.env.GEM_HOME), and returns
// the absolute path to it
export async function installBundler(meta: Meta, gemfileContents: string) {
// If the new File System API is used (`avoidTopLevelInstall`), the Install Command
// will have already installed the dependencies, so we don't need to do it again.
if (meta.avoidTopLevelInstall) {
debug(
`Skipping bundler installation, already installed by Install Command`
);
}
const { gemHome, rubyPath, gemPath, vendorPath, runtime } = getRubyPath(
meta,
gemfileContents