diff --git a/Commands/gitInit.js b/Commands/gitInit.js index ebe4f35..ec20040 100644 --- a/Commands/gitInit.js +++ b/Commands/gitInit.js @@ -11,17 +11,13 @@ const gitInitCommand = { try { chalk.Message("Checking whether git is initialised"); process.chdir(folderPath); - if ( - execSync("git status", { stdio: [] }) - .toString() - .startsWith("On branch") - ) { + if (execSync("git status").toString().startsWith("On branch")) { chalk.Warning("git already initialised"); } } catch (error) { try { chalk.Message("git initialisation started"); - execSync("git init -b main", { stdio: [] }); + execSync("git init -b main"); chalk.Success("git initialisation completed"); } catch (error) { chalk.Error("git was not initialised"); diff --git a/Jest/globalSetup.js b/Jest/globalSetup.js index 5254cf4..9f29caa 100644 --- a/Jest/globalSetup.js +++ b/Jest/globalSetup.js @@ -6,9 +6,7 @@ const wpFolderPath = require("../Utils/folderPaths").wpFolderPath(); module.exports = function () { // save current working dir in to revert to it in teardown process.env.initialPath = process.cwd(); - execSync("npm link", { - stdio: [], - }); + execSync("npm link"); fs.mkdirSync(parentFolderPath, { recursive: true }); diff --git a/Jest/globalTeardown.js b/Jest/globalTeardown.js index 5ad1b0f..22156b2 100644 --- a/Jest/globalTeardown.js +++ b/Jest/globalTeardown.js @@ -4,9 +4,13 @@ const execSync = require("child_process").execSync; const parentFolderPath = require("../Utils/folderPaths").parentFolderPath(); module.exports = function () { + //skip when running in GitHub + if (process.env.GITHUB_JOB !== undefined) return; + + // start teardown process.chdir(os.homedir()); - execSync("npm uninstall prettier sort-package-json --global", { stdio: [] }); + execSync("npm uninstall prettier sort-package-json --global"); fs.rmSync(parentFolderPath, { recursive: true, diff --git a/Utils/gitCommit.js b/Utils/gitCommit.js index 2abd1c3..af493ad 100644 --- a/Utils/gitCommit.js +++ b/Utils/gitCommit.js @@ -4,8 +4,8 @@ const chalk = require("./chalk"); module.exports = function (commitMessage) { try { - execSync("git add .", { stdio: [] }); - execSync(`git commit -m "` + commitMessage + `"`, { stdio: [] }); + execSync("git add ."); + execSync(`git commit -m "` + commitMessage + `"`); chalk.Success("git commit: " + commitMessage); } catch (error) { try {