Skip to content

Commit

Permalink
chore: reduce baseDir naming
Browse files Browse the repository at this point in the history
  • Loading branch information
rarkins committed Feb 4, 2021
1 parent d29dae5 commit a6a7ecd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions bin/clean-cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const path = require('path');

(async () => {
const tmpDir = process.env.RENOVATE_TMPDIR || os.tmpdir();
const baseDir = path.join(tmpDir, 'renovate');
console.log('Removing ' + baseDir);
await fs.remove(baseDir);
const renovateDir = path.join(tmpDir, 'renovate');
console.log('Removing ' + renovateDir);
await fs.remove(renovateDir);
})();
6 changes: 3 additions & 3 deletions lib/manager/nuget/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ export async function getConfiguredRegistries(
// 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 baseDir = upath.normalizeSafe(localDir);
const normalizedLocalDir = upath.normalizeSafe(localDir);
const nuGetConfigPath = await findUp(nuGetConfigFileNames, {
cwd: upath.dirname(upath.join(baseDir, packageFile)),
cwd: upath.dirname(upath.join(normalizedLocalDir, packageFile)),
type: 'file',
});

if (
!nuGetConfigPath ||
upath.normalizeSafe(nuGetConfigPath).startsWith(baseDir) !== true
upath.normalizeSafe(nuGetConfigPath).startsWith(normalizedLocalDir) !== true
) {
return undefined;
}
Expand Down

0 comments on commit a6a7ecd

Please sign in to comment.