mirror of
https://github.com/kunkunsh/kunkun.git
synced 2025-04-04 14:46:42 +00:00
fix: identifier conflict for dev and prod ext during installation
dev and prod environment could have the same identifier. If a dev ext is installed, user gets a warning prompt when installing from store, saying there is an existing extension. The dev extension will be removed from DB. In this commit we filter out dev extension
This commit is contained in:
parent
f78403eeb6
commit
9cda312523
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "create-kunkun",
|
||||
"type": "module",
|
||||
"version": "0.1.38",
|
||||
"version": "0.1.39",
|
||||
"bin": {
|
||||
"create-kunkun": "dist/index.mjs"
|
||||
},
|
||||
|
@ -8,6 +8,7 @@ import {
|
||||
QuickLinkCmd
|
||||
} from "@kksh/api/models"
|
||||
import * as v from "valibot"
|
||||
import { isExtPathInDev } from "./utils"
|
||||
|
||||
export async function upsertExtension(extPkgJson: ExtPackageJson, extFullPath: string) {
|
||||
const extInDb = await db.getUniqueExtensionByIdentifier(extPkgJson.kunkun.identifier)
|
||||
|
@ -14,6 +14,7 @@ import { download } from "@tauri-apps/plugin-upload"
|
||||
import { v4 as uuidv4 } from "uuid"
|
||||
import { z, ZodError } from "zod"
|
||||
import { loadExtensionManifestFromDisk } from "./load"
|
||||
import { isExtPathInDev } from "./utils"
|
||||
|
||||
/**
|
||||
*
|
||||
@ -58,7 +59,8 @@ export async function installTarball(
|
||||
|
||||
// find extension in db, if exists, ask user if they want to overwrite it
|
||||
const exts = await db.getAllExtensionsByIdentifier(manifest.kunkun.identifier)
|
||||
if (exts.length > 0) {
|
||||
const storeExts = exts.filter((ext) => ext.path && !isExtPathInDev(extsDir, ext.path))
|
||||
if (storeExts.length > 0) {
|
||||
const overwrite = await dialog.ask(
|
||||
`Extension ${manifest.kunkun.identifier} already exists in database (but not on disk), do you want to overwrite it?`
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user