mirror of
https://github.com/ivabus/gui
synced 2025-04-23 14:07:14 +03:00
fix arch subscription (#424)
* #423 fix arch subscription * skip subscription in brewkit_mnt --------- Co-authored-by: neil molina <neil@neils-MacBook-Pro.local>
This commit is contained in:
parent
b49b6572ce
commit
b2126bc82e
2 changed files with 7 additions and 2 deletions
|
@ -42,8 +42,13 @@ export async function subscribeToPackageTopic(pkgFullname: string) {
|
|||
try {
|
||||
if (Pushy.isRegistered()) {
|
||||
const slug = nameToSlug(pkgFullname);
|
||||
|
||||
// override rules for brewkit_mnt
|
||||
if (slug.includes("brewkit_mnt")) return;
|
||||
|
||||
const platformArch = getTopicArch();
|
||||
const topic = `packages-${slug}_${platformArch}`;
|
||||
|
||||
await Pushy.subscribe(topic);
|
||||
log.info("push: registered to pkg-topic: ", topic);
|
||||
} else {
|
||||
|
@ -108,7 +113,7 @@ enum PlatformArch {
|
|||
}
|
||||
|
||||
export function getTopicArch() {
|
||||
const arch = (process.arch as string) === "aarch64" ? "aarch64" : "x86-64";
|
||||
const arch = (process.arch as string) === "arm64" ? "aarch64" : "x86-64";
|
||||
const platform = process.platform === "darwin" ? "darwin" : "linux";
|
||||
return `${platform}_${arch}` as PlatformArch;
|
||||
}
|
||||
|
|
|
@ -164,7 +164,7 @@ export async function updatePackageInstalledList(list: InstalledPackage[]) {
|
|||
export async function deletePackageFolder(fullName, version) {
|
||||
try {
|
||||
const foldPath = path.join(getTeaPath(), fullName, `v${version}`);
|
||||
console.log(foldPath);
|
||||
log.info("rm:", foldPath);
|
||||
await fs.rmdirSync(foldPath, { recursive: true });
|
||||
} catch (error) {
|
||||
log.error(error);
|
||||
|
|
Loading…
Reference in a new issue