mirror of
https://github.com/Zagrios/bs-manager.git
synced 2026-07-03 14:08:25 +02:00
[chore] remove useless deps (ctrlc-windows, is-online)
This commit is contained in:
Generated
+92
-537
File diff suppressed because it is too large
Load Diff
@@ -244,7 +244,6 @@
|
||||
"framer-motion": "^10.12.16",
|
||||
"fs-extra": "^11.1.1",
|
||||
"history": "^5.3.0",
|
||||
"is-online": "^9.0.1",
|
||||
"jszip": "^3.10.1",
|
||||
"md5-file": "^5.0.0",
|
||||
"node-fetch": "^2.6.7",
|
||||
|
||||
Generated
-11
@@ -11,7 +11,6 @@
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@resvg/resvg-js": "^2.4.1",
|
||||
"ctrlc-windows": "^2.1.0",
|
||||
"ps-list": "^7.2.0"
|
||||
}
|
||||
},
|
||||
@@ -217,11 +216,6 @@
|
||||
"node": ">= 10"
|
||||
}
|
||||
},
|
||||
"node_modules/ctrlc-windows": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/ctrlc-windows/-/ctrlc-windows-2.1.0.tgz",
|
||||
"integrity": "sha512-OrX5KI+K+2NMN91QIhYZdW7VDO2YsSdTZW494pA7Nvw/wBdU2hz+MGP006bR978zOTrG6Q8EIeJvLJmLqc6MsQ=="
|
||||
},
|
||||
"node_modules/ps-list": {
|
||||
"version": "7.2.0",
|
||||
"resolved": "https://registry.npmjs.org/ps-list/-/ps-list-7.2.0.tgz",
|
||||
@@ -326,11 +320,6 @@
|
||||
"integrity": "sha512-vY4kTLH2S3bP+puU5x7hlAxHv+ulFgcK6Zn3efKSr0M0KnZ9A3qeAjZteIpkowEFfUeMPNg2dvvoFRJA9zqxSw==",
|
||||
"optional": true
|
||||
},
|
||||
"ctrlc-windows": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/ctrlc-windows/-/ctrlc-windows-2.1.0.tgz",
|
||||
"integrity": "sha512-OrX5KI+K+2NMN91QIhYZdW7VDO2YsSdTZW494pA7Nvw/wBdU2hz+MGP006bR978zOTrG6Q8EIeJvLJmLqc6MsQ=="
|
||||
},
|
||||
"ps-list": {
|
||||
"version": "7.2.0",
|
||||
"resolved": "https://registry.npmjs.org/ps-list/-/ps-list-7.2.0.tgz",
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@resvg/resvg-js": "^2.4.1",
|
||||
"ctrlc-windows": "^2.1.0",
|
||||
"ps-list": "^7.2.0"
|
||||
},
|
||||
"license": "MIT"
|
||||
|
||||
@@ -5,12 +5,11 @@ import { UtilsService } from "./utils.service";
|
||||
import { ChildProcessWithoutNullStreams, spawn, spawnSync } from "child_process";
|
||||
import log from "electron-log";
|
||||
import { InstallationLocationService } from "./installation-location.service";
|
||||
import { ctrlc } from "ctrlc-windows";
|
||||
import { BSLocalVersionService } from "./bs-local-version.service";
|
||||
import isOnline from "is-online";
|
||||
import { WindowManagerService } from "./window-manager.service";
|
||||
import { copy } from "fs-extra";
|
||||
import { ensureFolderExist, pathExist } from "../helpers/fs.helpers";
|
||||
import { net } from "electron";
|
||||
|
||||
export class BSInstallerService {
|
||||
private static instance: BSInstallerService;
|
||||
@@ -61,20 +60,8 @@ export class BSInstallerService {
|
||||
}
|
||||
}
|
||||
|
||||
public killDownloadProcess(): Promise<boolean> {
|
||||
return new Promise(resolve => {
|
||||
if (this.downloadProcess?.killed && !this.downloadProcess?.pid) {
|
||||
return resolve(false);
|
||||
}
|
||||
|
||||
this.downloadProcess?.once("exit", () => resolve(true));
|
||||
if (process.platform === "win32") {
|
||||
ctrlc(this.downloadProcess.pid);
|
||||
} else {
|
||||
this.downloadProcess.kill();
|
||||
}
|
||||
setTimeout(() => resolve(false), 3000);
|
||||
});
|
||||
public killDownloadProcess(): boolean {
|
||||
return this.downloadProcess.kill();
|
||||
}
|
||||
|
||||
public async isDotNet6Installed(): Promise<boolean> {
|
||||
@@ -101,7 +88,7 @@ export class BSInstallerService {
|
||||
if (!bsVersion) {
|
||||
return { type: "[Error]" };
|
||||
}
|
||||
if (!(await isOnline({ timeout: 1500 }))) {
|
||||
if (!net.isOnline()) {
|
||||
throw "no-internet";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user