mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-12 15:06:27 +00:00
fix(repo-cache): pass relative paths to fs layer (#26227)
This commit is contained in:
parent
e1dd622a9b
commit
9474f9a5d7
2 changed files with 3 additions and 5 deletions
2
lib/util/cache/repository/impl/local.spec.ts
vendored
2
lib/util/cache/repository/impl/local.spec.ts
vendored
|
@ -188,7 +188,7 @@ describe('util/cache/repository/impl/local', () => {
|
||||||
`Repository cache type not supported using type "local" instead`,
|
`Repository cache type not supported using type "local" instead`,
|
||||||
);
|
);
|
||||||
expect(fs.outputCacheFile).toHaveBeenCalledWith(
|
expect(fs.outputCacheFile).toHaveBeenCalledWith(
|
||||||
'/tmp/cache/renovate/repository/github/some/repo.json',
|
'renovate/repository/github/some/repo.json',
|
||||||
JSON.stringify(newCacheRecord),
|
JSON.stringify(newCacheRecord),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
6
lib/util/cache/repository/impl/local.ts
vendored
6
lib/util/cache/repository/impl/local.ts
vendored
|
@ -1,5 +1,4 @@
|
||||||
import upath from 'upath';
|
import upath from 'upath';
|
||||||
import { GlobalConfig } from '../../../../config/global';
|
|
||||||
import { logger } from '../../../../logger';
|
import { logger } from '../../../../logger';
|
||||||
import { cachePathExists, outputCacheFile, readCacheFile } from '../../../fs';
|
import { cachePathExists, outputCacheFile, readCacheFile } from '../../../fs';
|
||||||
import type { RepoCacheRecord } from '../schema';
|
import type { RepoCacheRecord } from '../schema';
|
||||||
|
@ -30,10 +29,9 @@ export class RepoCacheLocal extends RepoCacheBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
private getCacheFileName(): string {
|
private getCacheFileName(): string {
|
||||||
const cacheDir = GlobalConfig.get('cacheDir');
|
const repoCachePath = 'renovate/repository/';
|
||||||
const repoCachePath = '/renovate/repository/';
|
|
||||||
const platform = this.platform;
|
const platform = this.platform;
|
||||||
const fileName = `${this.repository}.json`;
|
const fileName = `${this.repository}.json`;
|
||||||
return upath.join(cacheDir, repoCachePath, platform, fileName);
|
return upath.join(repoCachePath, platform, fileName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue