Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
malice00 committed Feb 4, 2025
1 parent 493f49c commit bb07458
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions lib/helpers/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -3800,13 +3800,15 @@ export function executeParallelGradleProperties(dir, allProjectsStr) {
"in",
dir,
);
const tempFileName = randomUUID();
const scriptOutputFile = join(`${dirname(gradleCmd)}`, `${tempFileName}.out`);
if (isWin) {
const batchFile = join(`${dirname(gradleCmd)}`, `${randomUUID()}.ps1`);
console.log(batchFile)
temporaryFiles.add(batchFile);
writeFileSync(batchFile, `$gradleOutput = & "${basename(gradleCmd)}" ${gradleArgs.join(" ")};return $gradleOutput;`);
const scriptFile = join(`${dirname(gradleCmd)}`, `${tempFileName}.ps1`);
temporaryFiles.add(scriptFile);
temporaryFiles.add(scriptOutputFile);
writeFileSync(scriptFile, `& ".\\${basename(gradleCmd)}" ${gradleArgs.join(" ")} | Out-File .\\${scriptFileOutput}`);
gradleCmd = "powershell";
gradleArgs = [`"$gradleOutput = & "".\\${basename(batchFile)}"";return $gradleOutput;"`];
gradleArgs = [`"& "".\\${basename(batchFile)}"""`];
console.log(
"Executing",
gradleCmd,
Expand Down Expand Up @@ -3848,7 +3850,10 @@ export function executeParallelGradleProperties(dir, allProjectsStr) {
}
}
}
const stdout = result.stdout;
let stdout = result.stdout;
if (isWin) {
stdout = readFileSync(scriptOutputFile);
}
if (stdout) {
return Buffer.from(stdout).toString();
}
Expand Down

0 comments on commit bb07458

Please sign in to comment.