Fixes on the admin initialization cmd

This commit is contained in:
Joseph Garrone 2024-12-22 21:57:52 +01:00
parent 96690e1354
commit 4f2790f6d3
2 changed files with 10 additions and 7 deletions

View File

@ -109,9 +109,12 @@ export async function command(params: { buildContext: BuildContext }) {
.toString("utf8") .toString("utf8")
.trim() .trim()
) as string[] ) as string[]
).find(version => )
uiSharedMajor === undefined ? true : version.startsWith(`${uiSharedMajor}.`) .reverse()
); .filter(version => !version.includes("-"))
.find(version =>
uiSharedMajor === undefined ? true : version.startsWith(`${uiSharedMajor}.`)
);
assert(version !== undefined); assert(version !== undefined);

View File

@ -105,16 +105,16 @@ async function runPackageManagerInstall(params: {
shell: true shell: true
}); });
child.stdout.on("data", data => { child.stdout.on("data", data => process.stdout.write(data));
child.stderr.on("data", data => {
if (data.toString("utf8").includes("has unmet peer dependency")) { if (data.toString("utf8").includes("has unmet peer dependency")) {
return; return;
} }
process.stdout.write(data); process.stderr.write(data);
}); });
child.stderr.on("data", data => process.stderr.write(data));
child.on("exit", code => { child.on("exit", code => {
if (code !== 0) { if (code !== 0) {
dCompleted.reject(new Error(`Failed with code ${code}`)); dCompleted.reject(new Error(`Failed with code ${code}`));