From 4d3fea197dc7dea78030fd3b177b6809315ba43e Mon Sep 17 00:00:00 2001 From: Mike Pirog Date: Wed, 13 Nov 2024 14:10:21 -0500 Subject: [PATCH] stop caching the mvb base/main/root build part 2 --- bin/mvb.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/mvb.js b/bin/mvb.js index 4bf8035..54e0b0e 100755 --- a/bin/mvb.js +++ b/bin/mvb.js @@ -151,7 +151,7 @@ const builds = extended.map((version, index) => { } // if caching then also suggest a cache location - if (options.cache && options.base !== '/') { + if (options.cache && version.base !== '/') { version.cacheKey = path.join(options.base, options.versionBase, version.version, version.base); version.cachePath = path.join(options.cacheDir, crypto.createHash('sha256').update(version.cacheKey).digest('hex')); } @@ -186,7 +186,7 @@ for (const build of builds) { // if we get here we need to actually do a build debug('building %o version %o with config %o', srcDir, `${alias ?? version}@${ref}`, config); - log('building version %s, ref %s, from %s to %s...', magenta(alias ?? version), magenta(ref), magenta(srcDir), magenta(config.outDir)); + log('building version %s, ref %s, from %s to %s...', magenta(alias ?? version), magenta(ref), magenta(srcDir), magenta(`${config.outDir}/`)); // reset HEAD HARD await exec('git', ['reset', 'HEAD', '--hard']); @@ -232,7 +232,7 @@ for (const build of builds) { fs.copySync(path.join(options.tmpDir, config.outDir), path.resolve(config.outDir)); // save cache if its on - if (options.cache) { + if (cachePath && options.cache) { debug('saving version %s to %s at %s...', version, 'cache', cachePath); fs.copySync(path.resolve(config.outDir), cachePath); }