mirror of
https://gitee.com/spark-store-project/spark-store
synced 2026-04-30 03:10:16 +08:00
fix(lint): 清理未使用的安装器符号
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
* 共享的安装/下载逻辑
|
* 共享的安装/下载逻辑
|
||||||
* 被 install-manager.ts 和 update-center 共同使用
|
* 被 install-manager.ts 和 update-center 共同使用
|
||||||
*/
|
*/
|
||||||
import { spawn, ChildProcess } from "node:child_process";
|
import { spawn } from "node:child_process";
|
||||||
import { createWriteStream } from "node:fs";
|
import { createWriteStream } from "node:fs";
|
||||||
import * as fs from "node:fs";
|
import * as fs from "node:fs";
|
||||||
import * as path from "node:path";
|
import * as path from "node:path";
|
||||||
@@ -34,7 +34,6 @@ export interface DownloadResult {
|
|||||||
* 与 install-manager.ts 中的下载逻辑保持一致
|
* 与 install-manager.ts 中的下载逻辑保持一致
|
||||||
*/
|
*/
|
||||||
export const downloadPackage = async ({
|
export const downloadPackage = async ({
|
||||||
pkgname,
|
|
||||||
metalinkUrl,
|
metalinkUrl,
|
||||||
filename,
|
filename,
|
||||||
downloadDir,
|
downloadDir,
|
||||||
@@ -225,7 +224,6 @@ export interface InstallOptions {
|
|||||||
* 与 install-manager.ts 中的安装逻辑保持一致
|
* 与 install-manager.ts 中的安装逻辑保持一致
|
||||||
*/
|
*/
|
||||||
export const installPackage = async ({
|
export const installPackage = async ({
|
||||||
pkgname,
|
|
||||||
filePath,
|
filePath,
|
||||||
origin,
|
origin,
|
||||||
superUserCmd,
|
superUserCmd,
|
||||||
@@ -265,8 +263,6 @@ export const installPackage = async ({
|
|||||||
env: process.env,
|
env: process.env,
|
||||||
});
|
});
|
||||||
|
|
||||||
let stdout = "";
|
|
||||||
let stderr = "";
|
|
||||||
let logBuffer = "";
|
let logBuffer = "";
|
||||||
let logBufferTimer: NodeJS.Timeout | null = null;
|
let logBufferTimer: NodeJS.Timeout | null = null;
|
||||||
const LOG_FLUSH_MS = 100;
|
const LOG_FLUSH_MS = 100;
|
||||||
@@ -295,12 +291,10 @@ export const installPackage = async ({
|
|||||||
signal?.addEventListener("abort", abortHandler, { once: true });
|
signal?.addEventListener("abort", abortHandler, { once: true });
|
||||||
|
|
||||||
child.stdout?.on("data", (data) => {
|
child.stdout?.on("data", (data) => {
|
||||||
stdout += data.toString();
|
|
||||||
bufferedSendLog(data.toString());
|
bufferedSendLog(data.toString());
|
||||||
});
|
});
|
||||||
|
|
||||||
child.stderr?.on("data", (data) => {
|
child.stderr?.on("data", (data) => {
|
||||||
stderr += data.toString();
|
|
||||||
bufferedSendLog(data.toString());
|
bufferedSendLog(data.toString());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { join } from "node:path";
|
import { downloadPackage } from "../shared-installer";
|
||||||
import { downloadPackage, type DownloadResult } from "../shared-installer";
|
|
||||||
import type { UpdateCenterItem } from "./types";
|
import type { UpdateCenterItem } from "./types";
|
||||||
|
|
||||||
export interface Aria2DownloadResult {
|
export interface Aria2DownloadResult {
|
||||||
|
|||||||
Reference in New Issue
Block a user