Merge pull request #751 from edoardopirovano/deprecare-rmdir
Remove calls to `fs.rmdirSync`
This commit is contained in:
commit
cd1b9df1e3
9 changed files with 11 additions and 11 deletions
2
lib/runner.js
generated
2
lib/runner.js
generated
|
|
@ -124,7 +124,7 @@ program
|
||||||
const checkoutPath = cmd.checkoutPath || process.cwd();
|
const checkoutPath = cmd.checkoutPath || process.cwd();
|
||||||
// Wipe the temp dir
|
// Wipe the temp dir
|
||||||
logger.info(`Cleaning temp directory ${tempDir}`);
|
logger.info(`Cleaning temp directory ${tempDir}`);
|
||||||
fs.rmdirSync(tempDir, { recursive: true });
|
fs.rmSync(tempDir, { recursive: true, force: true });
|
||||||
fs.mkdirSync(tempDir, { recursive: true });
|
fs.mkdirSync(tempDir, { recursive: true });
|
||||||
const auth = await (0, util_1.getGitHubAuth)(logger, cmd.githubAuth, cmd.githubAuthStdin);
|
const auth = await (0, util_1.getGitHubAuth)(logger, cmd.githubAuth, cmd.githubAuthStdin);
|
||||||
const apiDetails = {
|
const apiDetails = {
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
4
lib/toolcache.js
generated
4
lib/toolcache.js
generated
|
|
@ -236,8 +236,8 @@ function createToolPath(tool, version, arch, toolCacheDir, logger) {
|
||||||
const folderPath = path.join(toolCacheDir, tool, semver.clean(version) || version, arch || "");
|
const folderPath = path.join(toolCacheDir, tool, semver.clean(version) || version, arch || "");
|
||||||
logger.debug(`destination ${folderPath}`);
|
logger.debug(`destination ${folderPath}`);
|
||||||
const markerPath = `${folderPath}.complete`;
|
const markerPath = `${folderPath}.complete`;
|
||||||
fs.rmdirSync(folderPath, { recursive: true });
|
fs.rmSync(folderPath, { recursive: true, force: true });
|
||||||
fs.rmdirSync(markerPath, { recursive: true });
|
fs.rmSync(markerPath, { recursive: true, force: true });
|
||||||
fs.mkdirSync(folderPath, { recursive: true });
|
fs.mkdirSync(folderPath, { recursive: true });
|
||||||
return folderPath;
|
return folderPath;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
2
lib/util.js
generated
2
lib/util.js
generated
|
|
@ -77,7 +77,7 @@ async function withTmpDir(body) {
|
||||||
const symlinkSubdir = path.join(tmpDir, "symlink");
|
const symlinkSubdir = path.join(tmpDir, "symlink");
|
||||||
fs.symlinkSync(realSubdir, symlinkSubdir, "dir");
|
fs.symlinkSync(realSubdir, symlinkSubdir, "dir");
|
||||||
const result = await body(symlinkSubdir);
|
const result = await body(symlinkSubdir);
|
||||||
fs.rmdirSync(tmpDir, { recursive: true });
|
fs.rmSync(tmpDir, { recursive: true, force: true });
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
exports.withTmpDir = withTmpDir;
|
exports.withTmpDir = withTmpDir;
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -177,7 +177,7 @@ program
|
||||||
|
|
||||||
// Wipe the temp dir
|
// Wipe the temp dir
|
||||||
logger.info(`Cleaning temp directory ${tempDir}`);
|
logger.info(`Cleaning temp directory ${tempDir}`);
|
||||||
fs.rmdirSync(tempDir, { recursive: true });
|
fs.rmSync(tempDir, { recursive: true, force: true });
|
||||||
fs.mkdirSync(tempDir, { recursive: true });
|
fs.mkdirSync(tempDir, { recursive: true });
|
||||||
|
|
||||||
const auth = await getGitHubAuth(
|
const auth = await getGitHubAuth(
|
||||||
|
|
|
||||||
|
|
@ -268,8 +268,8 @@ function createToolPath(
|
||||||
);
|
);
|
||||||
logger.debug(`destination ${folderPath}`);
|
logger.debug(`destination ${folderPath}`);
|
||||||
const markerPath = `${folderPath}.complete`;
|
const markerPath = `${folderPath}.complete`;
|
||||||
fs.rmdirSync(folderPath, { recursive: true });
|
fs.rmSync(folderPath, { recursive: true, force: true });
|
||||||
fs.rmdirSync(markerPath, { recursive: true });
|
fs.rmSync(markerPath, { recursive: true, force: true });
|
||||||
fs.mkdirSync(folderPath, { recursive: true });
|
fs.mkdirSync(folderPath, { recursive: true });
|
||||||
return folderPath;
|
return folderPath;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ export async function withTmpDir<T>(
|
||||||
const symlinkSubdir = path.join(tmpDir, "symlink");
|
const symlinkSubdir = path.join(tmpDir, "symlink");
|
||||||
fs.symlinkSync(realSubdir, symlinkSubdir, "dir");
|
fs.symlinkSync(realSubdir, symlinkSubdir, "dir");
|
||||||
const result = await body(symlinkSubdir);
|
const result = await body(symlinkSubdir);
|
||||||
fs.rmdirSync(tmpDir, { recursive: true });
|
fs.rmSync(tmpDir, { recursive: true, force: true });
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue