From f1bcd405ee850130963753d6e81d5b1a89490034 Mon Sep 17 00:00:00 2001 From: Tom Taylor Date: Fri, 27 Sep 2024 22:26:27 +0100 Subject: [PATCH] Fix: Refactor CacheManager to use cachepath grunt option internally (#3600) --- grunt/helpers/CacheManager.js | 3 +-- grunt/tasks/javascript.js | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/grunt/helpers/CacheManager.js b/grunt/helpers/CacheManager.js index 2a10fff64..4c7934a3d 100644 --- a/grunt/helpers/CacheManager.js +++ b/grunt/helpers/CacheManager.js @@ -24,8 +24,7 @@ module.exports = class CacheManager { } get tempPath() { - const tempPath = path.join(os.tmpdir(), 'adapt_framework'); - return tempPath; + return this.grunt.option('cachepath') ?? path.join(os.tmpdir(), 'adapt_framework'); } cachePath(basePath, outputFilePath = process.cwd()) { diff --git a/grunt/tasks/javascript.js b/grunt/tasks/javascript.js index 14635fc61..1bd4ba854 100644 --- a/grunt/tasks/javascript.js +++ b/grunt/tasks/javascript.js @@ -130,7 +130,7 @@ module.exports = function(grunt) { const options = this.options({}); const isSourceMapped = Boolean(options.generateSourceMaps); const basePath = path.resolve(cwd + '/' + options.baseUrl).replace(convertSlashes, '/') + '/'; - const cachePath = buildConfig.cachepath ?? cacheManager.cachePath(cwd, options.out); + const cachePath = cacheManager.cachePath(cwd, options.out); if (!isDisableCache) { grunt.log.ok(`Cache path: ${cachePath}`); }