mirror of
https://github.com/ruby/setup-ruby.git
synced 2026-09-13 06:34:19 +02:00
Don't group bundle install output
* So any error from Bundler is immediately shown. * Some users do not realize they should expand the group apparently.
This commit is contained in:
@@ -47,6 +47,19 @@ export async function measure(name, block) {
|
||||
}
|
||||
}
|
||||
|
||||
// Same as mesaure() but without the group
|
||||
export async function time(name, block) {
|
||||
console.log(`> ${name}`)
|
||||
const start = performance.now()
|
||||
try {
|
||||
return await block()
|
||||
} finally {
|
||||
const end = performance.now()
|
||||
const duration = (end - start) / 1000.0
|
||||
console.log(`Took ${duration.toFixed(2).padStart(6)} seconds`)
|
||||
}
|
||||
}
|
||||
|
||||
export function isHeadVersion(rubyVersion) {
|
||||
return ['head', 'debug', 'mingw', 'mswin', 'ucrt'].includes(rubyVersion)
|
||||
}
|
||||
|
||||
+15
-1
@@ -282,6 +282,7 @@ __nccwpck_require__.r(__webpack_exports__);
|
||||
/* harmony export */ "drive": () => (/* binding */ drive),
|
||||
/* harmony export */ "partition": () => (/* binding */ partition),
|
||||
/* harmony export */ "measure": () => (/* binding */ measure),
|
||||
/* harmony export */ "time": () => (/* binding */ time),
|
||||
/* harmony export */ "isHeadVersion": () => (/* binding */ isHeadVersion),
|
||||
/* harmony export */ "isStableVersion": () => (/* binding */ isStableVersion),
|
||||
/* harmony export */ "hasBundlerDefaultGem": () => (/* binding */ hasBundlerDefaultGem),
|
||||
@@ -348,6 +349,19 @@ async function measure(name, block) {
|
||||
}
|
||||
}
|
||||
|
||||
// Same as mesaure() but without the group
|
||||
async function time(name, block) {
|
||||
console.log(`> ${name}`)
|
||||
const start = performance.now()
|
||||
try {
|
||||
return await block()
|
||||
} finally {
|
||||
const end = performance.now()
|
||||
const duration = (end - start) / 1000.0
|
||||
console.log(`Took ${duration.toFixed(2).padStart(6)} seconds`)
|
||||
}
|
||||
}
|
||||
|
||||
function isHeadVersion(rubyVersion) {
|
||||
return ['head', 'debug', 'mingw', 'mswin', 'ucrt'].includes(rubyVersion)
|
||||
}
|
||||
@@ -68822,7 +68836,7 @@ async function setupRuby(options = {}) {
|
||||
}
|
||||
|
||||
if (inputs['bundler-cache'] === 'true') {
|
||||
await common.measure('bundle install', async () =>
|
||||
await common.time('bundle install', async () =>
|
||||
bundler.bundleInstall(gemfile, lockFile, platform, engine, version, bundlerVersion, inputs['cache-version']))
|
||||
}
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ export async function setupRuby(options = {}) {
|
||||
}
|
||||
|
||||
if (inputs['bundler-cache'] === 'true') {
|
||||
await common.measure('bundle install', async () =>
|
||||
await common.time('bundle install', async () =>
|
||||
bundler.bundleInstall(gemfile, lockFile, platform, engine, version, bundlerVersion, inputs['cache-version']))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user