diff --git a/lib/config/admin.ts b/lib/config/admin.ts index 73f289d209476153391e823c43c0949ff961fc8a..f560d59ead77f1eeea5d961c9a3a0cd818161e1b 100644 --- a/lib/config/admin.ts +++ b/lib/config/admin.ts @@ -16,7 +16,7 @@ const repoAdminOptions = [ 'exposeAllEnv', 'migratePresets', 'privateKey', - 'localDir', + 'cloneDir', 'cacheDir', ]; diff --git a/lib/config/types.ts b/lib/config/types.ts index bd56a58505b444e53877110a431d7ec6c3b32ca4..4094f0b5de0b64eb6dfa1068478cbcd8c1967072 100644 --- a/lib/config/types.ts +++ b/lib/config/types.ts @@ -98,14 +98,14 @@ export interface RepoAdminConfig { exposeAllEnv?: boolean; migratePresets?: Record<string, string>; privateKey?: string | Buffer; - localDir?: string; + cloneDir?: string; cacheDir?: string; } export interface LegacyAdminConfig { endpoint?: string; - localDir?: string; + cloneDir?: string; logContext?: string; diff --git a/lib/datasource/crate/index.spec.ts b/lib/datasource/crate/index.spec.ts index 00ae5986f2c7cb88cdf73a4d559190c9d94bb695..b367998addfaea1a7ce1a84e94b247f16c121b63 100644 --- a/lib/datasource/crate/index.spec.ts +++ b/lib/datasource/crate/index.spec.ts @@ -83,7 +83,7 @@ describe(getName(), () => { tmpDir = await dir(); adminConfig = { - localDir: join(tmpDir.path, 'local'), + cloneDir: join(tmpDir.path, 'local'), cacheDir: join(tmpDir.path, 'cache'), }; setAdminConfig(adminConfig); diff --git a/lib/manager/batect/extract.spec.ts b/lib/manager/batect/extract.spec.ts index 9596f4b7bb23a47de5a07764af128f9fee2821ec..8d1640fb65559f55262ab6f61c7e620e6eac98f0 100644 --- a/lib/manager/batect/extract.spec.ts +++ b/lib/manager/batect/extract.spec.ts @@ -28,7 +28,7 @@ function createGitDependency(repo: string, version: string): PackageDependency { } const adminConfig: RepoAdminConfig = { - localDir: '', + cloneDir: '', }; const config: ExtractConfig = {}; diff --git a/lib/manager/bundler/artifacts.spec.ts b/lib/manager/bundler/artifacts.spec.ts index 05cf2d6ca7c56e4ecb50ee278e91d839f59e3afe..78b1b33a5c850fd724d1b79ba803ccd8bb9ead17 100644 --- a/lib/manager/bundler/artifacts.spec.ts +++ b/lib/manager/bundler/artifacts.spec.ts @@ -30,7 +30,7 @@ jest.mock('./host-rules'); const adminConfig: RepoAdminConfig = { // `join` fixes Windows CI - localDir: join('/tmp/github/some/repo'), + cloneDir: join('/tmp/github/some/repo'), cacheDir: join('/tmp/cache'), }; diff --git a/lib/manager/cargo/artifacts.spec.ts b/lib/manager/cargo/artifacts.spec.ts index a2c8bf0fc32388ee90fff1ccae7296ab1debed99..397212c8162ba1dbf19df2e2bb6187e32292fdf8 100644 --- a/lib/manager/cargo/artifacts.spec.ts +++ b/lib/manager/cargo/artifacts.spec.ts @@ -26,7 +26,7 @@ const config: UpdateArtifactsConfig = {}; const adminConfig: RepoAdminConfig = { // `join` fixes Windows CI - localDir: join('/tmp/github/some/repo'), + cloneDir: join('/tmp/github/some/repo'), }; describe('.updateArtifacts()', () => { diff --git a/lib/manager/cargo/extract.spec.ts b/lib/manager/cargo/extract.spec.ts index 25cd4087e2b9eed8454bb062c66313ef9b6dc456..d6356fbe20655752cdec4af899277d8120c6bc28 100644 --- a/lib/manager/cargo/extract.spec.ts +++ b/lib/manager/cargo/extract.spec.ts @@ -24,7 +24,7 @@ describe(getName(), () => { config = {}; const tmpDir = await dir(); adminConfig = { - localDir: join(tmpDir.path, 'local'), + cloneDir: join(tmpDir.path, 'local'), cacheDir: join(tmpDir.path, 'cache'), }; diff --git a/lib/manager/cocoapods/artifacts.spec.ts b/lib/manager/cocoapods/artifacts.spec.ts index 2944f67e22553af8fe0c5ac5d6b8ad26c10cf239..836cfb2a5cd7cd7bf60f79995a0cd822299e3878 100644 --- a/lib/manager/cocoapods/artifacts.spec.ts +++ b/lib/manager/cocoapods/artifacts.spec.ts @@ -30,7 +30,7 @@ delete process.env.CP_HOME_DIR; const config: UpdateArtifactsConfig = {}; const adminConfig: RepoAdminConfig = { - localDir: join('/tmp/github/some/repo'), + cloneDir: join('/tmp/github/some/repo'), cacheDir: join('/tmp/cache'), }; @@ -83,7 +83,7 @@ describe('.updateArtifacts()', () => { it('returns null for invalid local directory', async () => { const execSnapshots = mockExecAll(exec); setAdminConfig({ - localDir: '', + cloneDir: '', }); expect( diff --git a/lib/manager/cocoapods/extract.spec.ts b/lib/manager/cocoapods/extract.spec.ts index 6ae2c5c64900ad3e17698b5e16d1a990bc882a32..1461fba6bd3f2c08dfa2ae32bc2d8e1747e359d6 100644 --- a/lib/manager/cocoapods/extract.spec.ts +++ b/lib/manager/cocoapods/extract.spec.ts @@ -7,7 +7,7 @@ const simplePodfile = loadFixture('Podfile.simple'); const complexPodfile = loadFixture('Podfile.complex'); const adminConfig: RepoAdminConfig = { - localDir: '', + cloneDir: '', }; describe(getName(), () => { diff --git a/lib/manager/composer/artifacts.spec.ts b/lib/manager/composer/artifacts.spec.ts index 23218407a9d28f8e5f4da269697319ef68644191..c5f6ce4e9cfe696ef1e1ca9c216e0d573b1fb7d2 100644 --- a/lib/manager/composer/artifacts.spec.ts +++ b/lib/manager/composer/artifacts.spec.ts @@ -35,7 +35,7 @@ const config: UpdateArtifactsConfig = { const adminConfig: RepoAdminConfig = { allowScripts: false, // `join` fixes Windows CI - localDir: join('/tmp/github/some/repo'), + cloneDir: join('/tmp/github/some/repo'), cacheDir: join('/tmp/renovate/cache'), }; diff --git a/lib/manager/git-submodules/extract.spec.ts b/lib/manager/git-submodules/extract.spec.ts index 89d28264607406f46f7314a8b7cc9d973ce841a9..1588172d1775fde953be20000780d0385a467662 100644 --- a/lib/manager/git-submodules/extract.spec.ts +++ b/lib/manager/git-submodules/extract.spec.ts @@ -44,7 +44,7 @@ describe(getName(), () => { }); describe('extractPackageFile()', () => { it('extracts submodules', async () => { - setAdminConfig({ localDir: `${__dirname}/__fixtures__` }); + setAdminConfig({ cloneDir: `${__dirname}/__fixtures__` }); hostRules.add({ matchHost: 'github.com', token: 'abc123' }); let res: PackageFile; expect(await extractPackageFile('', '.gitmodules.1', {})).toBeNull(); diff --git a/lib/manager/git-submodules/extract.ts b/lib/manager/git-submodules/extract.ts index 7c92f1b13f3f441af9dc5e5242ffd89ce9a3fc57..a835367bab7efdd5dc8e79f5a33ebef71b564e14 100644 --- a/lib/manager/git-submodules/extract.ts +++ b/lib/manager/git-submodules/extract.ts @@ -88,9 +88,9 @@ export default async function extractPackageFile( fileName: string, config: ManagerConfig ): Promise<PackageFile | null> { - const { localDir } = getAdminConfig(); - const git = Git(localDir); - const gitModulesPath = upath.join(localDir, fileName); + const { cloneDir } = getAdminConfig(); + const git = Git(cloneDir); + const gitModulesPath = upath.join(cloneDir, fileName); const depNames = await getModules(git, gitModulesPath); diff --git a/lib/manager/git-submodules/update.spec.ts b/lib/manager/git-submodules/update.spec.ts index 9887e7ceb89c07968ccc8a5c29217fa1614a1001..b4069c7b775d26a5bc6103bc71ec72a8a070816c 100644 --- a/lib/manager/git-submodules/update.spec.ts +++ b/lib/manager/git-submodules/update.spec.ts @@ -18,7 +18,7 @@ describe(getName(), () => { upgrade = { depName: 'renovate' }; const tmpDir = await dir(); - adminConfig = { localDir: join(tmpDir.path) }; + adminConfig = { cloneDir: join(tmpDir.path) }; setAdminConfig(adminConfig); }); afterAll(() => { diff --git a/lib/manager/git-submodules/update.ts b/lib/manager/git-submodules/update.ts index da05a5ae460d19454a2060cc0f4c1c2c2bb2c149..7df8506c22cac13b0c184b7172611c141d37dfd5 100644 --- a/lib/manager/git-submodules/update.ts +++ b/lib/manager/git-submodules/update.ts @@ -8,9 +8,9 @@ export default async function updateDependency({ fileContent, upgrade, }: UpdateDependencyConfig): Promise<string | null> { - const { localDir } = getAdminConfig(); - const git = Git(localDir); - const submoduleGit = Git(upath.join(localDir, upgrade.depName)); + const { cloneDir } = getAdminConfig(); + const git = Git(cloneDir); + const submoduleGit = Git(upath.join(cloneDir, upgrade.depName)); try { await git.submoduleUpdate(['--init', upgrade.depName]); diff --git a/lib/manager/gitlabci/extract.spec.ts b/lib/manager/gitlabci/extract.spec.ts index ae3f1f30765e569cf1f3e3c17bf76c790fedaabb..9e1faf537b52e41bd0b190910ea9a13535596ad5 100644 --- a/lib/manager/gitlabci/extract.spec.ts +++ b/lib/manager/gitlabci/extract.spec.ts @@ -6,7 +6,7 @@ import { extractAllPackageFiles } from './extract'; const config: ExtractConfig = {}; -const adminConfig: RepoAdminConfig = { localDir: '' }; +const adminConfig: RepoAdminConfig = { cloneDir: '' }; describe(getName(), () => { beforeEach(() => { diff --git a/lib/manager/gomod/artifacts.spec.ts b/lib/manager/gomod/artifacts.spec.ts index 0d5f5db94803288170c46f37189b90102e721ee9..e37e529aa3de8202828b1d7cca1cd4d63d78e0fe 100644 --- a/lib/manager/gomod/artifacts.spec.ts +++ b/lib/manager/gomod/artifacts.spec.ts @@ -40,7 +40,7 @@ replace github.com/pkg/errors => ../errors const adminConfig: RepoAdminConfig = { // `join` fixes Windows CI - localDir: join('/tmp/github/some/repo'), + cloneDir: join('/tmp/github/some/repo'), cacheDir: join('/tmp/renovate/cache'), }; diff --git a/lib/manager/gradle-wrapper/artifacts-real.spec.ts b/lib/manager/gradle-wrapper/artifacts-real.spec.ts index 3df946849148e16742aa2e485731e48795dab03f..c1542f06e56c2a0205a248e3ab65362eaecde2e3 100644 --- a/lib/manager/gradle-wrapper/artifacts-real.spec.ts +++ b/lib/manager/gradle-wrapper/artifacts-real.spec.ts @@ -16,7 +16,7 @@ jest.mock('../../util/git'); const fixtures = resolve(__dirname, './__fixtures__'); const adminConfig: RepoAdminConfig = { - localDir: resolve(fixtures, './testFiles'), + cloneDir: resolve(fixtures, './testFiles'), }; const config: UpdateArtifactsConfig = { @@ -169,7 +169,7 @@ describe(getName(), () => { it('gradlew failed', async () => { const wrongCmdConfig = { ...adminConfig, - localDir: resolve(fixtures, './wrongCmd'), + cloneDir: resolve(fixtures, './wrongCmd'), }; await setExecConfig(wrongCmdConfig); @@ -196,7 +196,7 @@ describe(getName(), () => { }); it('gradlew not found', async () => { - setAdminConfig({ localDir: 'some-dir' }); + setAdminConfig({ cloneDir: 'some-dir' }); const res = await dcUpdate.updateArtifacts({ packageFileName: 'gradle-wrapper.properties', updatedDeps: [], @@ -243,7 +243,7 @@ describe(getName(), () => { expect( await readString( - adminConfig.localDir, + adminConfig.cloneDir, `./gradle/wrapper/gradle-wrapper.properties` ) ).toEqual(newContent); diff --git a/lib/manager/gradle-wrapper/artifacts.spec.ts b/lib/manager/gradle-wrapper/artifacts.spec.ts index 16f92f1dd04732d6a7243b077eabf6e897a7fc9c..446d981150d512b8cec82d9de65d30d0f0bbcc59 100644 --- a/lib/manager/gradle-wrapper/artifacts.spec.ts +++ b/lib/manager/gradle-wrapper/artifacts.spec.ts @@ -30,7 +30,7 @@ const exec: jest.Mock<typeof _exec> = _exec as any; const fixtures = resolve(__dirname, './__fixtures__'); const adminConfig: RepoAdminConfig = { - localDir: resolve(fixtures, './testFiles'), + cloneDir: resolve(fixtures, './testFiles'), }; const dockerAdminConfig = { ...adminConfig, binarySource: BinarySource.Docker }; @@ -105,7 +105,7 @@ describe(getName(), () => { }); it('gradlew not found', async () => { - setAdminConfig({ ...adminConfig, localDir: 'some-dir' }); + setAdminConfig({ ...adminConfig, cloneDir: 'some-dir' }); const res = await dcUpdate.updateArtifacts({ packageFileName: 'gradle-wrapper.properties', updatedDeps: [], diff --git a/lib/manager/gradle-wrapper/artifacts.ts b/lib/manager/gradle-wrapper/artifacts.ts index e377604b26d4c9673f00099cc9035ff22b1727ac..9eee8f75dae2541d95f89aa57a837acdefc6dcec 100644 --- a/lib/manager/gradle-wrapper/artifacts.ts +++ b/lib/manager/gradle-wrapper/artifacts.ts @@ -55,7 +55,7 @@ export async function updateArtifacts({ config, }: UpdateArtifact): Promise<UpdateArtifactsResult[] | null> { try { - const { localDir: projectDir } = getAdminConfig(); + const { cloneDir: projectDir } = getAdminConfig(); logger.debug({ updatedDeps }, 'gradle-wrapper.updateArtifacts()'); const gradlew = gradleWrapperFileName(config); const gradlewPath = resolve(projectDir, `./${gradlew}`); diff --git a/lib/manager/gradle/gradle-updates-report.ts b/lib/manager/gradle/gradle-updates-report.ts index e90ca8960053c27935509d0d3aab915e4bcabba9..2c428f1c1f4e3f3ae6e1b60552dfeefdf438fc91 100644 --- a/lib/manager/gradle/gradle-updates-report.ts +++ b/lib/manager/gradle/gradle-updates-report.ts @@ -11,7 +11,7 @@ import type { export const GRADLE_DEPENDENCY_REPORT_FILENAME = 'gradle-renovate-report.json'; export async function createRenovateGradlePlugin( - localDir: string + cloneDir: string ): Promise<void> { const content = ` import groovy.json.JsonOutput @@ -47,16 +47,16 @@ gradle.buildFinished { def json = JsonOutput.toJson(output) outputFile.write json }`; - const gradleInitFile = join(localDir, 'renovate-plugin.gradle'); + const gradleInitFile = join(cloneDir, 'renovate-plugin.gradle'); logger.debug( 'Creating renovate-plugin.gradle file with renovate gradle plugin' ); await writeFile(gradleInitFile, content); } -async function readGradleReport(localDir: string): Promise<GradleProject[]> { +async function readGradleReport(cloneDir: string): Promise<GradleProject[]> { const renovateReportFilename = join( - localDir, + cloneDir, GRADLE_DEPENDENCY_REPORT_FILENAME ); if (!(await exists(renovateReportFilename))) { @@ -123,9 +123,9 @@ function buildDependency( } export async function extractDependenciesFromUpdatesReport( - localDir: string + cloneDir: string ): Promise<BuildDependency[]> { - const gradleProjectConfigurations = await readGradleReport(localDir); + const gradleProjectConfigurations = await readGradleReport(cloneDir); const dependencies = gradleProjectConfigurations .map(mergeDependenciesWithRepositories, []) diff --git a/lib/manager/gradle/index-real.spec.ts b/lib/manager/gradle/index-real.spec.ts index 0b126bff9b398a56242cb6b211643c81a646d21d..758ff1e0fe0432d78597a6775747472c28dcc447 100644 --- a/lib/manager/gradle/index-real.spec.ts +++ b/lib/manager/gradle/index-real.spec.ts @@ -26,7 +26,7 @@ describe(getName(), () => { beforeEach(async () => { workingDir = await tmp.dir({ unsafeCleanup: true }); successFile = ''; - adminConfig = { localDir: workingDir.path }; + adminConfig = { cloneDir: workingDir.path }; setAdminConfig(adminConfig); testRunConfig = { ...baseConfig }; await fsExtra.copy(`${fixtures}/minimal-project`, workingDir.path); diff --git a/lib/manager/gradle/index.spec.ts b/lib/manager/gradle/index.spec.ts index 7171b2ac817aa2b474bda45f4d1857d32f1deb50..93bb0dfc24d77efbe166fe944b5fe18ac8b545ae 100644 --- a/lib/manager/gradle/index.spec.ts +++ b/lib/manager/gradle/index.spec.ts @@ -29,7 +29,7 @@ jest.mock('../../util/exec/env'); const env = mocked(_env); const adminConfig: RepoAdminConfig = { - localDir: join('/foo/bar'), + cloneDir: join('/foo/bar'), }; const dockerAdminConfig = { diff --git a/lib/manager/gradle/index.ts b/lib/manager/gradle/index.ts index a463bb45e5d8b3f884a28671d8ea535964616666..af651177eea2d86533717b17c827aa0bc100e019 100644 --- a/lib/manager/gradle/index.ts +++ b/lib/manager/gradle/index.ts @@ -93,11 +93,11 @@ export async function extractAllPackageFiles( ): Promise<PackageFile[] | null> { let rootBuildGradle: string | undefined; let gradlew: Stats | null; - const { localDir } = getAdminConfig(); + const { cloneDir } = getAdminConfig(); for (const packageFile of packageFiles) { const dirname = upath.dirname(packageFile); const gradlewPath = upath.join(dirname, gradleWrapperFileName(config)); - gradlew = await stat(upath.join(localDir, gradlewPath)).catch(() => null); + gradlew = await stat(upath.join(cloneDir, gradlewPath)).catch(() => null); if (['build.gradle', 'build.gradle.kts'].includes(packageFile)) { rootBuildGradle = packageFile; @@ -116,7 +116,7 @@ export async function extractAllPackageFiles( } logger.debug('Extracting dependencies from all gradle files'); - const cwd = upath.join(localDir, upath.dirname(rootBuildGradle)); + const cwd = upath.join(cloneDir, upath.dirname(rootBuildGradle)); await createRenovateGradlePlugin(cwd); await executeGradle(config, cwd, gradlew); diff --git a/lib/manager/helmv3/artifacts.spec.ts b/lib/manager/helmv3/artifacts.spec.ts index 0fcb69da2be1ecec0ff21cd8c03db16d3bbda722..f6c60354892306c801705716d0be694b3ca7fe14 100644 --- a/lib/manager/helmv3/artifacts.spec.ts +++ b/lib/manager/helmv3/artifacts.spec.ts @@ -23,7 +23,7 @@ const exec: jest.Mock<typeof _exec> = _exec as any; const env = mocked(_env); const adminConfig: RepoAdminConfig = { - localDir: join('/tmp/github/some/repo'), // `join` fixes Windows CI + cloneDir: join('/tmp/github/some/repo'), // `join` fixes Windows CI }; const config: UpdateArtifactsConfig = {}; diff --git a/lib/manager/mix/artifacts.spec.ts b/lib/manager/mix/artifacts.spec.ts index 16824a564bb1c739d254fdb1555d32c85fe1bed8..8fee8421c6ac3962d1a1d833342d3826ddd88f87 100644 --- a/lib/manager/mix/artifacts.spec.ts +++ b/lib/manager/mix/artifacts.spec.ts @@ -15,7 +15,7 @@ jest.mock('../../util/fs'); const adminConfig: RepoAdminConfig = { // `join` fixes Windows CI - localDir: join('/tmp/github/some/repo'), + cloneDir: join('/tmp/github/some/repo'), }; const config: UpdateArtifactsConfig = {}; diff --git a/lib/manager/mix/extract.spec.ts b/lib/manager/mix/extract.spec.ts index 0a452b6d3909653b0a814e02a5ff3a7f9f9e8094..c4b1dc3b3bceab4cee66c4924d45719219e053fb 100644 --- a/lib/manager/mix/extract.spec.ts +++ b/lib/manager/mix/extract.spec.ts @@ -6,7 +6,7 @@ const sample = loadFixture('mix.exs'); describe(getName(), () => { beforeEach(() => { - setAdminConfig({ localDir: '' }); + setAdminConfig({ cloneDir: '' }); }); describe('extractPackageFile()', () => { diff --git a/lib/manager/npm/extract/pnpm.spec.ts b/lib/manager/npm/extract/pnpm.spec.ts index b0ade19f8da7e7c1e252bfbeae7d791b58651ec2..dadb9225e0180494c68bc4af113e92aa11595e6c 100644 --- a/lib/manager/npm/extract/pnpm.spec.ts +++ b/lib/manager/npm/extract/pnpm.spec.ts @@ -10,7 +10,7 @@ import { describe(getName(), () => { beforeAll(() => { - setAdminConfig({ localDir: getFixturePath('pnpm-monorepo/', '..') }); + setAdminConfig({ cloneDir: getFixturePath('pnpm-monorepo/', '..') }); }); describe('.extractPnpmFilters()', () => { diff --git a/lib/manager/npm/post-update/index.ts b/lib/manager/npm/post-update/index.ts index 1e45616c596e8bfc5244621f2cc13c83cf93ff26..f37b5f5490b22862a43105b12e8496b9125f0b53 100644 --- a/lib/manager/npm/post-update/index.ts +++ b/lib/manager/npm/post-update/index.ts @@ -139,10 +139,10 @@ export async function writeExistingFiles( { packageFiles: npmFiles.map((n) => n.packageFile) }, 'Writing package.json files' ); - const { localDir } = getAdminConfig(); + const { cloneDir } = getAdminConfig(); for (const packageFile of npmFiles) { const basedir = upath.join( - localDir, + cloneDir, upath.dirname(packageFile.packageFile) ); const npmrc: string = packageFile.npmrc || config.npmrc; @@ -170,7 +170,7 @@ export async function writeExistingFiles( } const { npmLock } = packageFile; if (npmLock) { - const npmLockPath = upath.join(localDir, npmLock); + const npmLockPath = upath.join(cloneDir, npmLock); if ( process.env.RENOVATE_REUSE_PACKAGE_LOCK === 'false' || config.reuseLockFiles === false @@ -232,12 +232,12 @@ export async function writeUpdatedPackageFiles( logger.debug('No files found'); return; } - const { localDir } = getAdminConfig(); + const { cloneDir } = getAdminConfig(); for (const packageFile of config.updatedPackageFiles) { if (packageFile.name.endsWith('package-lock.json')) { logger.debug(`Writing package-lock file: ${packageFile.name}`); await outputFile( - upath.join(localDir, packageFile.name), + upath.join(cloneDir, packageFile.name), packageFile.contents ); continue; // eslint-disable-line @@ -266,7 +266,7 @@ export async function writeUpdatedPackageFiles( logger.warn({ err }, 'Error adding token to package files'); } await outputFile( - upath.join(localDir, packageFile.name), + upath.join(cloneDir, packageFile.name), JSON.stringify(massagedFile) ); } @@ -332,7 +332,7 @@ async function resetNpmrcContent( // istanbul ignore next async function updateYarnOffline( lockFileDir: string, - localDir: string, + cloneDir: string, updatedArtifacts: UpdatedArtifacts[] ): Promise<void> { try { @@ -372,7 +372,7 @@ async function updateYarnOffline( const status = await getRepoStatus(); for (const f of status.modified.concat(status.not_added)) { if (resolvedPaths.some((p) => f.startsWith(p))) { - const localModified = upath.join(localDir, f); + const localModified = upath.join(cloneDir, f); updatedArtifacts.push({ name: f, contents: await readFile(localModified), @@ -463,10 +463,10 @@ export async function getAdditionalFiles( } catch (err) { logger.warn({ err }, 'Error getting token for packageFile'); } - const { localDir } = getAdminConfig(); + const { cloneDir } = getAdminConfig(); for (const npmLock of dirs.npmLockDirs) { const lockFileDir = upath.dirname(npmLock); - const fullLockFileDir = upath.join(localDir, lockFileDir); + const fullLockFileDir = upath.join(cloneDir, lockFileDir); const npmrcContent = await getNpmrcContent(fullLockFileDir); await updateNpmrcContent( fullLockFileDir, @@ -529,7 +529,7 @@ export async function getAdditionalFiles( for (const yarnLock of dirs.yarnLockDirs) { const lockFileDir = upath.dirname(yarnLock); - const fullLockFileDir = upath.join(localDir, lockFileDir); + const fullLockFileDir = upath.join(cloneDir, lockFileDir); const npmrcContent = await getNpmrcContent(fullLockFileDir); await updateNpmrcContent( fullLockFileDir, @@ -561,7 +561,7 @@ export async function getAdditionalFiles( (upgrade) => upgrade.yarnLock === yarnLock ); const res = await yarn.generateLockFile( - upath.join(localDir, lockFileDir), + upath.join(cloneDir, lockFileDir), env, config, upgrades @@ -607,7 +607,7 @@ export async function getAdditionalFiles( name: lockFileName, contents: res.lockFile, }); - await updateYarnOffline(lockFileDir, localDir, updatedArtifacts); + await updateYarnOffline(lockFileDir, cloneDir, updatedArtifacts); } } await resetNpmrcContent(fullLockFileDir, npmrcContent); @@ -618,7 +618,7 @@ export async function getAdditionalFiles( for (const pnpmShrinkwrap of dirs.pnpmShrinkwrapDirs) { const lockFileDir = upath.dirname(pnpmShrinkwrap); - const fullLockFileDir = upath.join(localDir, lockFileDir); + const fullLockFileDir = upath.join(cloneDir, lockFileDir); const npmrcContent = await getNpmrcContent(fullLockFileDir); await updateNpmrcContent( fullLockFileDir, @@ -630,7 +630,7 @@ export async function getAdditionalFiles( (upgrade) => upgrade.pnpmShrinkwrap === pnpmShrinkwrap ); const res = await pnpm.generateLockFile( - upath.join(localDir, lockFileDir), + upath.join(cloneDir, lockFileDir), env, config, upgrades @@ -697,7 +697,7 @@ export async function getAdditionalFiles( const skipInstalls = lockFile === 'npm-shrinkwrap.json' ? false : config.skipInstalls; const fullLearnaFileDir = upath.join( - localDir, + cloneDir, getSubDirectory(lernaJsonFile) ); const npmrcContent = await getNpmrcContent(fullLearnaFileDir); @@ -769,7 +769,7 @@ export async function getAdditionalFiles( ); if (existingContent) { logger.trace('Found lock file'); - const lockFilePath = upath.join(localDir, filename); + const lockFilePath = upath.join(cloneDir, filename); logger.trace('Checking against ' + lockFilePath); try { let newContent: string; diff --git a/lib/manager/nuget/artifacts.spec.ts b/lib/manager/nuget/artifacts.spec.ts index 877d8de308442eb8162d017326e07baee465783b..8df82c36122e898ebb3e1444ccc26a1debcb80b4 100644 --- a/lib/manager/nuget/artifacts.spec.ts +++ b/lib/manager/nuget/artifacts.spec.ts @@ -35,7 +35,7 @@ const hostRules = mocked(_hostRules); const adminConfig: RepoAdminConfig = { // `join` fixes Windows CI - localDir: join('/tmp/github/some/repo'), + cloneDir: join('/tmp/github/some/repo'), cacheDir: join('/tmp/renovate/cache'), }; diff --git a/lib/manager/nuget/artifacts.ts b/lib/manager/nuget/artifacts.ts index f36891f0d94bb8f11c52d767b1ec61234f155ef2..084be4141b1040451a796a98e17eb658b6924eed 100644 --- a/lib/manager/nuget/artifacts.ts +++ b/lib/manager/nuget/artifacts.ts @@ -29,9 +29,9 @@ async function addSourceCmds( config: UpdateArtifactsConfig, nugetConfigFile: string ): Promise<string[]> { - const { localDir } = getAdminConfig(); + const { cloneDir } = getAdminConfig(); const registries = - (await getConfiguredRegistries(packageFileName, localDir)) || + (await getConfiguredRegistries(packageFileName, cloneDir)) || getDefaultRegistries(); const result = []; for (const registry of registries) { diff --git a/lib/manager/nuget/extract.spec.ts b/lib/manager/nuget/extract.spec.ts index 95ac00b0600dd25656f5d5807fcd7c922b50a494..b6fb56aa761902cd639dbedbb8abd17f10cf38ea 100644 --- a/lib/manager/nuget/extract.spec.ts +++ b/lib/manager/nuget/extract.spec.ts @@ -8,7 +8,7 @@ import { extractPackageFile } from './extract'; const config: ExtractConfig = {}; const adminConfig: RepoAdminConfig = { - localDir: upath.resolve('lib/manager/nuget/__fixtures__'), + cloneDir: upath.resolve('lib/manager/nuget/__fixtures__'), }; describe(getName(), () => { diff --git a/lib/manager/nuget/extract.ts b/lib/manager/nuget/extract.ts index 27a6ebecafbb53e1f15f0bc326c92ccec6e5ca6d..0956aa48d1367acd25ee252553bf20a66bb367d2 100644 --- a/lib/manager/nuget/extract.ts +++ b/lib/manager/nuget/extract.ts @@ -71,8 +71,8 @@ export async function extractPackageFile( ): Promise<PackageFile | null> { logger.trace({ packageFile }, 'nuget.extractPackageFile()'); - const { localDir } = getAdminConfig(); - const registries = await getConfiguredRegistries(packageFile, localDir); + const { cloneDir } = getAdminConfig(); + const registries = await getConfiguredRegistries(packageFile, cloneDir); const registryUrls = registries ? registries.map((registry) => registry.url) : undefined; diff --git a/lib/manager/nuget/util.ts b/lib/manager/nuget/util.ts index d7fcd54f03e71645df3e810bfff79e088f75bce4..894b22f9cbbf84077e5d452752ff1e984c4b1b97 100644 --- a/lib/manager/nuget/util.ts +++ b/lib/manager/nuget/util.ts @@ -32,12 +32,12 @@ export function getDefaultRegistries(): Registry[] { export async function getConfiguredRegistries( packageFile: string, - localDir: string + cloneDir: string ): Promise<Registry[] | undefined> { // Valid file names taken from https://github.com/NuGet/NuGet.Client/blob/f64621487c0b454eda4b98af853bf4a528bef72a/src/NuGet.Core/NuGet.Configuration/Settings/Settings.cs#L34 const nuGetConfigFileNames = ['nuget.config', 'NuGet.config', 'NuGet.Config']; // normalize paths, otherwise startsWith can fail because of path delimitter mismatch - const normalizedLocalDir = upath.normalizeSafe(localDir); + const normalizedLocalDir = upath.normalizeSafe(cloneDir); const nuGetConfigPath = await findUp(nuGetConfigFileNames, { cwd: upath.dirname(upath.join(normalizedLocalDir, packageFile)), type: 'file', diff --git a/lib/manager/pip_requirements/artifacts.spec.ts b/lib/manager/pip_requirements/artifacts.spec.ts index 4cad75929c76e35c1700ccdd9038567edb6d32ce..f810010c1f825659846739ebbb73f133800a2aec 100644 --- a/lib/manager/pip_requirements/artifacts.spec.ts +++ b/lib/manager/pip_requirements/artifacts.spec.ts @@ -19,7 +19,7 @@ describe('.updateArtifacts()', () => { beforeEach(() => { jest.resetAllMocks(); jest.resetModules(); - setAdminConfig({ localDir: '' }); + setAdminConfig({ cloneDir: '' }); }); it('returns null if no updatedDeps were provided', async () => { expect( diff --git a/lib/manager/pip_setup/extract.spec.ts b/lib/manager/pip_setup/extract.spec.ts index 37c254d32e286ab6b6aaec4bcc993d37ced88433..785904fca570733c79540b25eb3bd45f1047cf29 100644 --- a/lib/manager/pip_setup/extract.spec.ts +++ b/lib/manager/pip_setup/extract.spec.ts @@ -18,7 +18,7 @@ describe(getName(), () => { resetModule(); env.getChildProcessEnv.mockReturnValue(envMock.basic); - setAdminConfig({ localDir: '/tmp/foo/bar' }); + setAdminConfig({ cloneDir: '/tmp/foo/bar' }); }); describe('parsePythonVersion', () => { it('returns major and minor version numbers', () => { diff --git a/lib/manager/pip_setup/index.spec.ts b/lib/manager/pip_setup/index.spec.ts index fffa8ae536a337168a7ca984c4cce3f6618b0936..7cfa11949f2ad54e0137074eb71bde2ddc4ffacc 100644 --- a/lib/manager/pip_setup/index.spec.ts +++ b/lib/manager/pip_setup/index.spec.ts @@ -20,7 +20,7 @@ const content = loadFixture(packageFile); const jsonContent = loadFixture('setup.py.json'); const adminConfig: RepoAdminConfig = { - localDir: '/tmp/github/some/repo', + cloneDir: '/tmp/github/some/repo', cacheDir: '/tmp/renovate/cache', }; diff --git a/lib/manager/pipenv/artifacts.spec.ts b/lib/manager/pipenv/artifacts.spec.ts index 64951dc94edecc8b06363f94b5ddb6f92dd370d9..ebd24182aa794190198225af1c6f395142250eb0 100644 --- a/lib/manager/pipenv/artifacts.spec.ts +++ b/lib/manager/pipenv/artifacts.spec.ts @@ -26,7 +26,7 @@ const env = mocked(_env); const adminConfig: RepoAdminConfig = { // `join` fixes Windows CI - localDir: join('/tmp/github/some/repo'), + cloneDir: join('/tmp/github/some/repo'), cacheDir: join('/tmp/renovate/cache'), }; const dockerAdminConfig = { ...adminConfig, binarySource: BinarySource.Docker }; diff --git a/lib/manager/poetry/artifacts.spec.ts b/lib/manager/poetry/artifacts.spec.ts index 85a77bc6cf639abf5de6e8020f8b3d00262b20a7..fd07cf0fc6afd10644af500b8ab8ad7ad0582c0d 100644 --- a/lib/manager/poetry/artifacts.spec.ts +++ b/lib/manager/poetry/artifacts.spec.ts @@ -29,7 +29,7 @@ const datasource = mocked(_datasource); const hostRules = mocked(_hostRules); const adminConfig: RepoAdminConfig = { - localDir: join('/tmp/github/some/repo'), + cloneDir: join('/tmp/github/some/repo'), }; const config: UpdateArtifactsConfig = {}; diff --git a/lib/util/exec/docker/index.ts b/lib/util/exec/docker/index.ts index b58a9d82d37c3a600f1c09d8a3a0870c69c65c00..17fd02288c2d9dfced3677b55efc006be8d9d8e4 100644 --- a/lib/util/exec/docker/index.ts +++ b/lib/util/exec/docker/index.ts @@ -197,7 +197,7 @@ export async function generateDockerCommand( const preCommands = options.preCommands || []; const postCommands = options.postCommands || []; const { - localDir, + cloneDir, cacheDir, dockerUser, dockerChildPrefix, @@ -212,7 +212,7 @@ export async function generateDockerCommand( result.push(`--user=${dockerUser}`); } - result.push(...prepareVolumes([localDir, cacheDir, ...volumes])); + result.push(...prepareVolumes([cloneDir, cacheDir, ...volumes])); if (envVars) { result.push( diff --git a/lib/util/exec/exec.spec.ts b/lib/util/exec/exec.spec.ts index b0b1c3cae367cf821ca3fc3afa5408b47af36087..26df36d4066938c23f17312ef0ac7994f85835b7 100644 --- a/lib/util/exec/exec.spec.ts +++ b/lib/util/exec/exec.spec.ts @@ -717,7 +717,7 @@ describe(getName(), () => { callback(null, { stdout: '', stderr: '' }); return undefined; }); - setAdminConfig({ cacheDir, localDir: cwd, ...adminConfig }); + setAdminConfig({ cacheDir, cloneDir: cwd, ...adminConfig }); await exec(cmd as string, inOpts); expect(actualCmd).toEqual(outCommand); diff --git a/lib/util/exec/index.ts b/lib/util/exec/index.ts index a01b886e5e0d83c39b0874fff385858e4b58fc25..ec2449455efb914d0d67100fd43c973f32aa706b 100644 --- a/lib/util/exec/index.ts +++ b/lib/util/exec/index.ts @@ -97,11 +97,11 @@ export async function exec( const extraEnv = { ...opts.extraEnv, ...customEnvVariables }; let cwd; // istanbul ignore if - const { localDir } = getAdminConfig(); + const { cloneDir } = getAdminConfig(); if (cwdFile) { - cwd = join(localDir, dirname(cwdFile)); + cwd = join(cloneDir, dirname(cwdFile)); } - cwd = cwd || opts.cwd || localDir; + cwd = cwd || opts.cwd || cloneDir; const childEnv = createChildEnv(env, extraEnv); const execOptions: ExecOptions = { ...opts }; diff --git a/lib/util/fs/index.spec.ts b/lib/util/fs/index.spec.ts index b8a05915e28bc5c51ba1ef1dfba2cc3e9534fe57..2d7571c55bd1dbfa9d7a28bf5d800fdcd9350e34 100644 --- a/lib/util/fs/index.spec.ts +++ b/lib/util/fs/index.spec.ts @@ -12,7 +12,7 @@ import { describe(getName(), () => { describe('readLocalFile', () => { beforeEach(() => { - setAdminConfig({ localDir: '' }); + setAdminConfig({ cloneDir: '' }); }); it('reads buffer', async () => { @@ -49,9 +49,9 @@ describe(getName(), () => { describe('findLocalSiblingOrParent', () => { it('returns path for file', async () => { await withDir( - async (localDir) => { + async (cloneDir) => { setAdminConfig({ - localDir: localDir.path, + cloneDir: cloneDir.path, }); await writeLocalFile('crates/one/Cargo.toml', ''); diff --git a/lib/util/fs/index.ts b/lib/util/fs/index.ts index 71f4c42bf3bc6c8479f51c1c8b152c31cb732ab9..cbb8b887535c10a985486cd8a367de5d70593ba9 100644 --- a/lib/util/fs/index.ts +++ b/lib/util/fs/index.ts @@ -26,8 +26,8 @@ export async function readLocalFile( fileName: string, encoding?: string ): Promise<string | Buffer> { - const { localDir } = getAdminConfig(); - const localFileName = join(localDir, fileName); + const { cloneDir } = getAdminConfig(); + const localFileName = join(cloneDir, fileName); try { const fileContent = await fs.readFile(localFileName, encoding); return fileContent; @@ -41,15 +41,15 @@ export async function writeLocalFile( fileName: string, fileContent: string ): Promise<void> { - const { localDir } = getAdminConfig(); - const localFileName = join(localDir, fileName); + const { cloneDir } = getAdminConfig(); + const localFileName = join(cloneDir, fileName); await fs.outputFile(localFileName, fileContent); } export async function deleteLocalFile(fileName: string): Promise<void> { - const { localDir } = getAdminConfig(); - if (localDir) { - const localFileName = join(localDir, fileName); + const { cloneDir } = getAdminConfig(); + if (cloneDir) { + const localFileName = join(cloneDir, fileName); await fs.remove(localFileName); } } @@ -59,8 +59,8 @@ export async function renameLocalFile( fromFile: string, toFile: string ): Promise<void> { - const { localDir } = getAdminConfig(); - await fs.move(join(localDir, fromFile), join(localDir, toFile)); + const { cloneDir } = getAdminConfig(); + await fs.move(join(cloneDir, fromFile), join(cloneDir, toFile)); } // istanbul ignore next @@ -70,8 +70,8 @@ export async function ensureDir(dirName: string): Promise<void> { // istanbul ignore next export async function ensureLocalDir(dirName: string): Promise<void> { - const { localDir } = getAdminConfig(); - const localDirName = join(localDir, dirName); + const { cloneDir } = getAdminConfig(); + const localDirName = join(cloneDir, dirName); await fs.ensureDir(localDirName); } @@ -97,10 +97,10 @@ export function privateCacheDir(): string { } export function localPathExists(pathName: string): Promise<boolean> { - const { localDir } = getAdminConfig(); + const { cloneDir } = getAdminConfig(); // Works for both files as well as directories return fs - .stat(join(localDir, pathName)) + .stat(join(cloneDir, pathName)) .then((s) => !!s) .catch(() => false); } @@ -109,7 +109,7 @@ export function localPathExists(pathName: string): Promise<boolean> { * Tries to find `otherFileName` in the directory where * `existingFileNameWithPath` is, then in its parent directory, then in the * grandparent, until we reach the top-level directory. All paths - * must be relative to `localDir`. + * must be relative to `cloneDir`. */ export async function findLocalSiblingOrParent( existingFileNameWithPath: string, diff --git a/lib/util/git/index.spec.ts b/lib/util/git/index.spec.ts index 4c7a231b94c5ed3d0677fd665c515c4ff303e154..159f8620a964f995666c09f93ffe9bdd2b6825e4 100644 --- a/lib/util/git/index.spec.ts +++ b/lib/util/git/index.spec.ts @@ -71,7 +71,7 @@ describe(getName(), () => { await repo.clone(base.path, '.', ['--bare']); await repo.addConfig('commit.gpgsign', 'false'); tmpDir = await tmp.dir({ unsafeCleanup: true }); - setAdminConfig({ localDir: tmpDir.path }); + setAdminConfig({ cloneDir: tmpDir.path }); await git.initRepo({ url: origin.path, gitAuthorName: 'Jest', diff --git a/lib/util/git/index.ts b/lib/util/git/index.ts index 1420f18a5c1ce82970a4f8204ff66c6f29594399..6cf2c29825184bb0d0dfcc99d5aba2a945fd7d8b 100644 --- a/lib/util/git/index.ts +++ b/lib/util/git/index.ts @@ -175,8 +175,8 @@ export async function initRepo(args: StorageConfig): Promise<void> { config.ignoredAuthors = []; config.additionalBranches = []; config.branchIsModified = {}; - const { localDir } = getAdminConfig(); - git = Git(localDir); + const { cloneDir } = getAdminConfig(); + git = Git(cloneDir); gitInitialized = false; await fetchBranchCommits(); } @@ -257,9 +257,9 @@ export async function syncGit(): Promise<void> { return; } gitInitialized = true; - const { localDir } = getAdminConfig(); - logger.debug('Initializing git repository into ' + localDir); - const gitHead = join(localDir, '.git/HEAD'); + const { cloneDir } = getAdminConfig(); + logger.debug('Initializing git repository into ' + cloneDir); + const gitHead = join(cloneDir, '.git/HEAD'); let clone = true; if (await fs.exists(gitHead)) { @@ -283,7 +283,7 @@ export async function syncGit(): Promise<void> { } } if (clone) { - await fs.emptyDir(localDir); + await fs.emptyDir(cloneDir); const cloneStart = Date.now(); try { // clone only the default branch @@ -696,8 +696,8 @@ export async function commitFiles({ await writePrivateKey(); privateKeySet = true; } - const { localDir } = getAdminConfig(); - await configSigningKey(localDir); + const { cloneDir } = getAdminConfig(); + await configSigningKey(cloneDir); try { await git.reset(ResetMode.HARD); await git.raw(['clean', '-fd']); @@ -708,7 +708,7 @@ export async function commitFiles({ // istanbul ignore if if (file.name === '|delete|') { deleted.push(file.contents as string); - } else if (await isDirectory(join(localDir, file.name))) { + } else if (await isDirectory(join(cloneDir, file.name))) { fileNames.push(file.name); await gitAdd(file.name); } else { @@ -720,7 +720,7 @@ export async function commitFiles({ } else { contents = file.contents; } - await fs.outputFile(join(localDir, file.name), contents); + await fs.outputFile(join(cloneDir, file.name), contents); } } // istanbul ignore if diff --git a/lib/workers/branch/execute-post-upgrade-commands.ts b/lib/workers/branch/execute-post-upgrade-commands.ts index 9e67efc3050cdd3649615c91f560f46d0a875c7b..0cc69120558c7ee33c78b7486a0d69c1c3e52b55 100644 --- a/lib/workers/branch/execute-post-upgrade-commands.ts +++ b/lib/workers/branch/execute-post-upgrade-commands.ts @@ -62,7 +62,7 @@ export async function postUpgradeCommandsExecutor( logger.debug({ cmd: compiledCmd }, 'Executing post-upgrade task'); const execResult = await exec(compiledCmd, { - cwd: getAdminConfig().localDir, + cwd: getAdminConfig().cloneDir, }); logger.debug( diff --git a/lib/workers/branch/index.spec.ts b/lib/workers/branch/index.spec.ts index dc348e821410ec786d3e6daaf5694ec6f4c072fa..c52528439d83752c55dd8ff95b1cafe06c5a06fc 100644 --- a/lib/workers/branch/index.spec.ts +++ b/lib/workers/branch/index.spec.ts @@ -63,7 +63,7 @@ const sanitize = mocked(_sanitize); const fs = mocked(_fs); const limits = mocked(_limits); -const adminConfig: RepoAdminConfig = { localDir: '', cacheDir: '' }; +const adminConfig: RepoAdminConfig = { cloneDir: '', cacheDir: '' }; describe(getName(), () => { describe('processBranch', () => { @@ -781,7 +781,7 @@ describe(getName(), () => { allowedPostUpgradeCommands: ['^echo {{{versioning}}}$'], allowPostUpgradeCommandTemplating: true, exposeAllEnv: true, - localDir: '/localDir', + cloneDir: '/cloneDir', }); const result = await branchWorker.processBranch({ @@ -806,7 +806,7 @@ describe(getName(), () => { expect(result).toMatchSnapshot(); expect(exec.exec).toHaveBeenCalledWith('echo semver', { - cwd: '/localDir', + cwd: '/cloneDir', }); const errorMessage = expect.stringContaining( "Post-upgrade command 'disallowed task' does not match allowed pattern '^echo {{{versioning}}}$'" @@ -861,7 +861,7 @@ describe(getName(), () => { allowedPostUpgradeCommands: ['^exit 1$'], allowPostUpgradeCommandTemplating: true, exposeAllEnv: true, - localDir: '/localDir', + cloneDir: '/cloneDir', }); exec.exec.mockRejectedValue(new Error('Meh, this went wrong!')); @@ -930,7 +930,7 @@ describe(getName(), () => { allowedPostUpgradeCommands: ['^echo {{{versioning}}}$'], allowPostUpgradeCommandTemplating: false, exposeAllEnv: true, - localDir: '/localDir', + cloneDir: '/cloneDir', }); const result = await branchWorker.processBranch({ ...config, @@ -954,7 +954,7 @@ describe(getName(), () => { expect(result).toMatchSnapshot(); expect(exec.exec).toHaveBeenCalledWith('echo {{{versioning}}}', { - cwd: '/localDir', + cwd: '/cloneDir', }); }); @@ -1010,7 +1010,7 @@ describe(getName(), () => { allowedPostUpgradeCommands: ['^echo {{{depName}}}$'], allowPostUpgradeCommandTemplating: true, exposeAllEnv: true, - localDir: '/localDir', + cloneDir: '/cloneDir', }); const inconfig: BranchConfig = { @@ -1061,10 +1061,10 @@ describe(getName(), () => { expect(result).toMatchSnapshot(); expect(exec.exec).toHaveBeenNthCalledWith(1, 'echo some-dep-name-1', { - cwd: '/localDir', + cwd: '/cloneDir', }); expect(exec.exec).toHaveBeenNthCalledWith(2, 'echo some-dep-name-2', { - cwd: '/localDir', + cwd: '/cloneDir', }); expect(exec.exec).toHaveBeenCalledTimes(2); expect( @@ -1144,7 +1144,7 @@ describe(getName(), () => { allowedPostUpgradeCommands: ['^echo hardcoded-string$'], allowPostUpgradeCommandTemplating: true, trustLevel: 'high', - localDir: '/localDir', + cloneDir: '/cloneDir', }); const inconfig: BranchConfig = { @@ -1194,7 +1194,7 @@ describe(getName(), () => { const result = await branchWorker.processBranch(inconfig); expect(result).toMatchSnapshot(); expect(exec.exec).toHaveBeenNthCalledWith(1, 'echo hardcoded-string', { - cwd: '/localDir', + cwd: '/cloneDir', }); expect(exec.exec).toHaveBeenCalledTimes(1); expect( diff --git a/lib/workers/branch/lock-files/index.spec.ts b/lib/workers/branch/lock-files/index.spec.ts index 947caf80d64a7b24dff73a3860f5dfa4e14d74f9..e232126270dd6f5642c407bc2146628daf29eb00 100644 --- a/lib/workers/branch/lock-files/index.spec.ts +++ b/lib/workers/branch/lock-files/index.spec.ts @@ -32,7 +32,7 @@ describe(getName(), () => { describe('writeUpdatedPackageFiles', () => { beforeEach(() => { setAdminConfig({ - localDir: 'some-tmp-dir', + cloneDir: 'some-tmp-dir', }); fs.outputFile = jest.fn(); }); @@ -71,7 +71,7 @@ describe(getName(), () => { describe('getAdditionalFiles', () => { beforeEach(() => { setAdminConfig({ - localDir: 'some-tmp-dir', + cloneDir: 'some-tmp-dir', }); git.getFile.mockResolvedValueOnce('some lock file contents'); npm.generateLockFile = jest.fn(); diff --git a/lib/workers/global/index.ts b/lib/workers/global/index.ts index 6d096d4f8c4ce39b93e573c34fda55cc5f98c881..06ee3438dbde9490ecad1bea2a6286a9499fcb05 100644 --- a/lib/workers/global/index.ts +++ b/lib/workers/global/index.ts @@ -29,11 +29,11 @@ export async function getRepositoryConfig( globalConfig, is.string(repository) ? { repository } : repository ); - repoConfig.localDir = upath.join( + repoConfig.cloneDir = upath.join( repoConfig.baseDir, `./repos/${repoConfig.platform}/${repoConfig.repository}` ); - await fs.ensureDir(repoConfig.localDir); + await fs.ensureDir(repoConfig.cloneDir); delete repoConfig.baseDir; return configParser.filterConfig(repoConfig, 'repository'); } diff --git a/lib/workers/repository/index.spec.ts b/lib/workers/repository/index.spec.ts index cbc9cd3d543a0b673b520bc7802a91466be4defc..78335894b87c333fb46c1658c7d56c50d6e2b1b5 100644 --- a/lib/workers/repository/index.spec.ts +++ b/lib/workers/repository/index.spec.ts @@ -18,7 +18,7 @@ describe(getName(), () => { let config: RenovateConfig; beforeEach(() => { config = getConfig(); - setAdminConfig({ localDir: '' }); + setAdminConfig({ cloneDir: '' }); }); it('runs', async () => { process.extractDependencies.mockResolvedValue(mock<ExtractResult>()); diff --git a/lib/workers/repository/index.ts b/lib/workers/repository/index.ts index ecce455412db6a37b05c6c4345cd00ed1d3bb387..611283572820a411f535f74d8188ebd731a84da9 100644 --- a/lib/workers/repository/index.ts +++ b/lib/workers/repository/index.ts @@ -34,10 +34,10 @@ export async function renovateRepository( logger.trace({ config }); let repoResult: ProcessResult; queue.clear(); - const { localDir } = getAdminConfig(); + const { cloneDir } = getAdminConfig(); try { - await fs.ensureDir(localDir); - logger.debug('Using localDir: ' + localDir); + await fs.ensureDir(cloneDir); + logger.debug('Using cloneDir: ' + cloneDir); config = await initRepo(config); addSplit('init'); const { branches, branchList, packageFiles } = await extractDependencies( @@ -57,11 +57,11 @@ export async function renovateRepository( const errorRes = await handleError(config, err); repoResult = processResult(config, errorRes); } - if (localDir && !config.persistRepoData) { + if (cloneDir && !config.persistRepoData) { try { await deleteLocalFile('.'); } catch (err) /* istanbul ignore if */ { - logger.warn({ err }, 'localDir deletion error'); + logger.warn({ err }, 'cloneDir deletion error'); } } try { diff --git a/lib/workers/repository/init/index.spec.ts b/lib/workers/repository/init/index.spec.ts index b453a079a3f929a957e915603e891bba0722e032..8e34aac67ff238364ee089db5f94a0486b014035 100644 --- a/lib/workers/repository/init/index.spec.ts +++ b/lib/workers/repository/init/index.spec.ts @@ -24,7 +24,7 @@ const secrets = mocked(_secrets); describe(getName(), () => { beforeEach(() => { - setAdminConfig({ localDir: '', cacheDir: '' }); + setAdminConfig({ cloneDir: '', cacheDir: '' }); }); afterEach(() => { setAdminConfig();