Run prettier

This commit is contained in:
Alexandru Dima 2021-11-12 10:55:50 +01:00
parent 734e1cb987
commit 9a52545094
No known key found for this signature in database
GPG key ID: 39563C1504FDD0C9
9 changed files with 97 additions and 62 deletions

View file

@ -82,7 +82,11 @@ exports.removeDir = removeDir;
function tsc(_projectPath) {
const projectPath = path.join(REPO_ROOT, _projectPath);
console.log(`Launching compiler at ${_projectPath}...`);
cp.spawnSync(process.execPath, [path.join(__dirname, '../node_modules/typescript/lib/tsc.js'), '-p', projectPath], { stdio: 'inherit', stderr: 'inherit' });
cp.spawnSync(
process.execPath,
[path.join(__dirname, '../node_modules/typescript/lib/tsc.js'), '-p', projectPath],
{ stdio: 'inherit', stderr: 'inherit' }
);
console.log(`Compiled ${_projectPath}`);
}
exports.tsc = tsc;
@ -94,7 +98,11 @@ exports.tsc = tsc;
*/
function prettier(_filePath) {
const filePath = path.join(REPO_ROOT, _filePath);
cp.spawnSync(process.execPath, [path.join(__dirname, '../node_modules/prettier/bin-prettier.js'), '--write', filePath], { stdio: 'inherit', stderr: 'inherit' });
cp.spawnSync(
process.execPath,
[path.join(__dirname, '../node_modules/prettier/bin-prettier.js'), '--write', filePath],
{ stdio: 'inherit', stderr: 'inherit' }
);
console.log(`Ran prettier over ${_filePath}`);
}
@ -189,7 +197,7 @@ function getGitVersion() {
let refsMatch;
const refs = {};
while (refsMatch = refsRegex.exec(refsRaw)) {
while ((refsMatch = refsRegex.exec(refsRaw))) {
refs[refsMatch[2]] = refsMatch[1];
}