Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated rmdirSync usage from internal scripts #3191

Merged
merged 1 commit into from Jun 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 4 additions & 5 deletions benchmark/benchmark.js
Expand Up @@ -31,17 +31,16 @@ 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.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, force: true });
fs.mkdirSync(projectPath);

fs.writeFileSync(
Expand Down Expand Up @@ -73,12 +72,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 });
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