mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-10 12:57:47 +00:00
[build-utils][ruby] Remove legacy avoidTopLevelInstall logic (#11513)
This logic was left over from a previous iteration of the `vc build` command which was never shipped. Thus, this logic is no longer necessary.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { EOL } from 'os';
|
||||
import { join, dirname, relative } from 'path';
|
||||
import { join, dirname } from 'path';
|
||||
import execa from 'execa';
|
||||
import {
|
||||
ensureDir,
|
||||
@@ -187,24 +187,9 @@ export const build: BuildV3 = async ({
|
||||
'did not find a vendor directory but found a Gemfile, bundling gems...'
|
||||
);
|
||||
|
||||
const fileAtRoot = relative(workPath, gemfilePath) === gemfileName;
|
||||
|
||||
// If the `Gemfile` is located in the Root Directory of the project and
|
||||
// the new File System API is used (`avoidTopLevelInstall`), the Install Command
|
||||
// will have already installed its dependencies, so we don't need to do it again.
|
||||
if (meta.avoidTopLevelInstall && fileAtRoot) {
|
||||
debug('Skipping `bundle install` — already handled by Install Command');
|
||||
} else {
|
||||
// try installing. this won't work if native extensions are required.
|
||||
// if that's the case, gems should be vendored locally before deploying.
|
||||
await bundleInstall(
|
||||
bundlerPath,
|
||||
bundleDir,
|
||||
gemfilePath,
|
||||
rubyPath,
|
||||
major
|
||||
);
|
||||
}
|
||||
// try installing. this won't work if native extensions are required.
|
||||
// if that's the case, gems should be vendored locally before deploying.
|
||||
await bundleInstall(bundlerPath, bundleDir, gemfilePath, rubyPath, major);
|
||||
}
|
||||
} else {
|
||||
debug('found vendor directory, skipping "bundle install"...');
|
||||
|
||||
@@ -108,24 +108,6 @@ export async function installBundler(meta: Meta, gemfileContents: string) {
|
||||
const { gemHome, rubyPath, gemPath, vendorPath, runtime, major } =
|
||||
getRubyPath(meta, gemfileContents);
|
||||
|
||||
// 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`
|
||||
);
|
||||
|
||||
return {
|
||||
major,
|
||||
gemHome,
|
||||
rubyPath,
|
||||
gemPath,
|
||||
vendorPath,
|
||||
runtime,
|
||||
bundlerPath: join(gemHome, 'bin', 'bundler'),
|
||||
};
|
||||
}
|
||||
|
||||
debug('installing bundler...');
|
||||
await execa(gemPath, ['install', 'bundler', '--no-document'], {
|
||||
stdio: 'pipe',
|
||||
|
||||
Reference in New Issue
Block a user