This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const chalk = require('chalk'); | |
const { exec } = require("child_process"); | |
const util = require('util'); | |
const execCommand = (command, displayError = true) => { | |
return new Promise(async (resolve, reject) => { | |
try { | |
const execPromise = util.promisify(exec); | |
const { stdout, error } = await execPromise(command, { cwd: process.cwd() }) | |
if (stdout) { | |
return resolve({ stdout, error: false }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require("fs"); | |
const writeToFile = (file, data) => | |
new Promise((resolve, reject) => { | |
try { | |
if (file) { | |
fs.writeFile(file, data, err => { | |
if (err) { | |
console.log("writeFile error: ", err); | |
resolve({ error: true }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
env: { | |
es2020: true, | |
node: true, | |
}, | |
parser: '@typescript-eslint/parser', | |
parserOptions: { | |
ecmaFeatures: { | |
jsx: true, | |
}, |
OlderNewer