1
0
mirror of https://github.com/citizenfx/cfx-server-data.git synced 2025-01-23 01:12:57 +08:00

fix: removed empty lines from the build stdout (#225)

* fix: removed empty lines from the build stdout

* revert: undone unwanted changes
This commit is contained in:
tabarra 2023-04-07 20:52:43 -03:00 committed by GitHub
parent 3e8e6dfc01
commit 0e7ba53833
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,6 +5,9 @@ let buildingInProgress = false;
let currentBuildingModule = '';
const initCwd = process.cwd();
const trimOutput = (data) => {
return `[yarn]\t` + data.toString().replace(/\s+$/, '');
}
const yarnBuildTask = {
shouldBuild(resourceName) {
@ -48,8 +51,8 @@ const yarnBuildTask = {
cwd: path.resolve(GetResourcePath(resourceName)),
stdio: 'pipe',
});
proc.stdout.on('data', (data) => console.log('[yarn]', data.toString()));
proc.stderr.on('data', (data) => console.error('[yarn]', data.toString()));
proc.stdout.on('data', (data) => console.log(trimOutput(data)));
proc.stderr.on('data', (data) => console.error(trimOutput(data)));
proc.on('exit', (code, signal) => {
setImmediate(() => {
if (code != 0 || signal) {