Compare commits

...

7 Commits

Author SHA1 Message Date
MathieuG-P efd69e4bb3 bumb to 1.3.0-alpha.5 2023-08-08 02:13:45 +02:00
MathieuG-P 90cb0d5038 Merge pull request #296 from Zagrios/bugfix/incorrect-text-colors-on-models-elemtnts-with-light-theme
[bugfix] Incorrect text colors on Models elements with light theme in download modal
2023-08-08 02:11:01 +02:00
MathieuG-P 73e8e0f15a Merge pull request #295 from Zagrios/bugfix/unable-download-bs-version-with-fresh-install
[bugfix] Ensure BSInstances exist before running depotdownloader
2023-08-08 02:07:10 +02:00
MathieuG-P b169b04637 [bugfix] Incorrect text colors on Models elements with light theme in download modal 2023-08-08 02:06:50 +02:00
MathieuG-P 6296a78cbc [bugfix] Ensure BSInstances exist before running depotdownloader 2023-08-08 01:51:07 +02:00
MathieuG-P 1305756cac add patreon 2023-08-07 19:07:48 +02:00
MathieuG-P 1f2601427b add patreon 2023-08-06 21:41:35 +02:00
5 changed files with 24 additions and 11 deletions
+3 -1
View File
@@ -13,5 +13,7 @@
{"username": "AndyIsHereBoi", "type": "gold"},
{"username": "grtroadrunner"},
{"username": "Ilnahro"},
{"username": "T3chLog"}
{"username": "T3chLog"},
{"username": "Phil", "type": "gold"},
{"username": "Protocrush", "type": "gold"}
]
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "bs-manager",
"version": "1.3.0-alpha.4",
"version": "1.3.0-alpha.5",
"description": "BSManager",
"main": "./dist/main/main.js",
"author": {
+15 -6
View File
@@ -8,9 +8,12 @@ export class DepotDownloader {
private processOut$: Observable<string>;
private subscriber: Subscriber<string>;
public constructor(options: {
command: string, args?: string[], options?: SpawnOptionsWithoutStdio, echoStartData?: unknown
}){
public constructor(
options: {
command: string, args?: string[], options?: SpawnOptionsWithoutStdio, echoStartData?: unknown
},
logger?: Logger
){
this.processOut$ = new Observable<string>(subscriber => {
@@ -25,11 +28,13 @@ export class DepotDownloader {
lines.forEach(line => subscriber.next(line));
});
this.process.on("error", error => subscriber.error(error));
this.process.stderr.on("error", error => subscriber.error(error));
this.process.on("exit", code => subscriber.complete());
this.process.on("exit", () => subscriber.complete());
return () => {
this.process.kill();
logger?.info("DepotDownloader process end with code", this.process.exitCode);
this.process = null;
}
@@ -48,8 +53,6 @@ export class DepotDownloader {
return this.processOut$.pipe(map(line => {
console.log(line);
const matched = (line.toString() as string).match(/(?:\[(.*?)\])\|(?:\[(.*?)\]\|)?(.*?)(?=$|\[)/gm)?.[0] ?? null;
if(!matched){ return null; }
@@ -98,4 +101,10 @@ export class DepotDownloader {
return args;
}
}
interface Logger {
info: (...args: unknown[]) => void,
warn: (...args: unknown[]) => void,
error: (...args: unknown[]) => void,
}
+4 -2
View File
@@ -7,7 +7,7 @@ import log from "electron-log";
import { InstallationLocationService } from "./installation-location.service";
import { BSLocalVersionService } from "./bs-local-version.service";
import { WindowManagerService } from "./window-manager.service";
import { copy } from "fs-extra";
import { copy, ensureDir } from "fs-extra";
import { pathExist } from "../helpers/fs.helpers";
import { Observable, map } from "rxjs";
import { DepotDownloaderArgsOptions, DepotDownloaderErrorEvent, DepotDownloaderEvent, DepotDownloaderEventType, DepotDownloaderInfoEvent } from "../../shared/models/depot-downloader.model";
@@ -77,12 +77,14 @@ export class BSInstallerService {
qr
}
await ensureDir(this.installLocationService.versionsDirectory);
return new DepotDownloader({
command: this.getDepotDownloaderExePath(),
args: DepotDownloader.buildArgs(depotDownloaderOptions),
options: { cwd: this.installLocationService.versionsDirectory },
echoStartData: downloadVersion
});
}, log);
}
private buildDepotDownloaderObservable(downloadInfos: DownloadInfo, qr?: boolean): Observable<DepotDownloaderEvent> {
@@ -112,7 +112,7 @@ function ModelItemElement<T = unknown>(props: Props<T>) {
};
return (
<motion.li className={`relative flex-grow min-w-[16rem] h-64 cursor-pointer ${props.className ?? ""}`} onHoverStart={() => setHovered(() => true)} onHoverEnd={() => setHovered(() => false)}>
<motion.li className={`relative flex-grow min-w-[16rem] h-64 cursor-pointer text-gray-200 ${props.className ?? ""}`} onHoverStart={() => setHovered(() => true)} onHoverEnd={() => setHovered(() => false)}>
<GlowEffect visible={props.selected || hovered} />
<div className="absolute top-0 left-0 w-full h-full rounded-lg overflow-hidden blur-none bg-black shadow-sm shadow-black">
<div ref={ref} className="contents">