Skip to content

Commit

Permalink
Remove deprecated rmdirSync usage from internal scripts
Browse files Browse the repository at this point in the history
Backport of graphql#2972 to 15.x.x branch
  • Loading branch information
IvanGoncharov committed Jun 20, 2021
1 parent b5dfb4c commit 65cc2fe
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions benchmark/benchmark.js
Expand Up @@ -31,17 +31,17 @@ function exec(command, options = {}) {
// and returns path to its 'dist' directory.
function prepareBenchmarkProjects(revisionList) {
const tmpDir = path.join(os.tmpdir(), 'graphql-js-benchmark');
fs.rmdirSync(tmpDir, { recursive: true, force: true });
fs.rmSync(tmpDir, { recursive: true, force: true });
fs.mkdirSync(tmpDir);

const setupDir = path.join(tmpDir, 'setup');
fs.rmdirSync(setupDir, { recursive: true, force: true });
fs.rmSync(setupDir, { recursive: true, force: true });
fs.mkdirSync(setupDir);

return revisionList.map((revision) => {
console.log(`🍳 Preparing ${revision}...`);
const projectPath = path.join(setupDir, revision);
fs.rmdirSync(projectPath, { recursive: true });
fs.rmSync(projectPath, { recursive: true });
fs.mkdirSync(projectPath);

fs.writeFileSync(
Expand Down Expand Up @@ -73,12 +73,12 @@ function prepareBenchmarkProjects(revisionList) {
}

const repoDir = path.join(tmpDir, hash);
fs.rmdirSync(repoDir, { recursive: true, force: true });
fs.rmSync(repoDir, { recursive: true, force: true });
fs.mkdirSync(repoDir);
exec(`git archive "${hash}" | tar -xC "${repoDir}"`);
exec('npm --quiet ci', { cwd: repoDir });
fs.renameSync(buildNPMArchive(repoDir), archivePath);
fs.rmdirSync(repoDir, { recursive: true, force: true });
fs.rmSync(repoDir, { recursive: true, force: true });
return archivePath;
}

Expand Down
2 changes: 1 addition & 1 deletion integrationTests/integration-test.js
Expand Up @@ -17,7 +17,7 @@ function exec(command, options = {}) {

describe('Integration Tests', () => {
const tmpDir = path.join(os.tmpdir(), 'graphql-js-integrationTmp');
fs.rmdirSync(tmpDir, { recursive: true, force: true });
fs.rmSync(tmpDir, { recursive: true, force: true });
fs.mkdirSync(tmpDir);

const distDir = path.resolve('./npmDist');
Expand Down
2 changes: 1 addition & 1 deletion resources/build-deno.js
Expand Up @@ -8,7 +8,7 @@ const babel = require('@babel/core');
const { readdirRecursive, showDirStats } = require('./utils');

if (require.main === module) {
fs.rmdirSync('./denoDist', { recursive: true, force: true });
fs.rmSync('./denoDist', { recursive: true, force: true });
fs.mkdirSync('./denoDist');

const srcFiles = readdirRecursive('./src', { ignoreDir: /^__.*__$/ });
Expand Down
2 changes: 1 addition & 1 deletion resources/build-npm.js
Expand Up @@ -9,7 +9,7 @@ const babel = require('@babel/core');
const { readdirRecursive, showDirStats } = require('./utils');

if (require.main === module) {
fs.rmdirSync('./npmDist', { recursive: true, force: true });
fs.rmSync('./npmDist', { recursive: true, force: true });
fs.mkdirSync('./npmDist');

const srcFiles = readdirRecursive('./src', { ignoreDir: /^__.*__$/ });
Expand Down

0 comments on commit 65cc2fe

Please sign in to comment.