Skip to content

Commit

Permalink
Use spawnSync instead of exec
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbjensen committed May 13, 2024
1 parent 4c634aa commit 5749533
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/bin/rcg.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// NPM Dependencies
const assert = require('assert');
const path = require('path');
const { spawnSync } = require('node:child_process');

// File Dependencies
const { exists, readdir, exec, readFile, unlink } = require('../helpers.js');
Expand All @@ -14,12 +15,12 @@ const {

const seed = async (dirs) => {
const dir = path.join(process.cwd(), ...dirs);
return await exec(`mkdir -p ${dir}`);
return spawnSync('mkdir', ['-p', dir]);
};

const cleanup = async (dir) => {
const fullPath = path.join(process.cwd(), dir);
return await exec(`rm -rf ${fullPath}`);
return spawnSync('rm', ['-rf', fullPath]);
};

const removeExampleConfigFile = async () => {
Expand Down

0 comments on commit 5749533

Please sign in to comment.