mirror of
https://gitee.com/spark-store-project/spark-store
synced 2026-04-30 03:10:16 +08:00
fix(update): 统一忽略更新配置到用户目录
This commit is contained in:
@@ -1,9 +1,16 @@
|
||||
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
||||
import { homedir } from "node:os";
|
||||
import { dirname } from "node:path";
|
||||
import { join } from "node:path";
|
||||
|
||||
import type { UpdateCenterItem } from "./types";
|
||||
|
||||
export const LEGACY_IGNORE_CONFIG_PATH = "/etc/spark-store/ignored_apps.conf";
|
||||
export const IGNORE_CONFIG_PATH = join(
|
||||
homedir(),
|
||||
".config",
|
||||
"spark-store",
|
||||
"ignored_apps.conf",
|
||||
);
|
||||
|
||||
const LEGACY_IGNORE_SEPARATOR = "|";
|
||||
|
||||
@@ -77,3 +84,15 @@ export const applyIgnoredEntries = (
|
||||
createIgnoreKey(item.pkgname, item.nextVersion),
|
||||
),
|
||||
}));
|
||||
|
||||
export const sortIgnoredItems = (
|
||||
items: UpdateCenterItem[],
|
||||
): UpdateCenterItem[] => {
|
||||
return [...items].sort((left, right) => {
|
||||
if (left.ignored === right.ignored) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return left.ignored === true ? 1 : -1;
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user