mirror of
https://gitee.com/spark-store-project/spark-store
synced 2026-08-10 06:14:07 +08:00
@@ -868,6 +868,23 @@ const isValidUrl = (url: string): boolean => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const getContributorFromGit = async (): Promise<string> => {
|
||||||
|
try {
|
||||||
|
const nameResult = await window.ipcRenderer.invoke("get-git-name");
|
||||||
|
const emailResult = await window.ipcRenderer.invoke("get-git-email");
|
||||||
|
|
||||||
|
const name = nameResult?.success ? nameResult.data : "";
|
||||||
|
const email = emailResult?.success ? emailResult.data : "";
|
||||||
|
|
||||||
|
if (name && email) {
|
||||||
|
return `${name} <${email}>`;
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.warn("[Submitter] Failed to get git config:", error);
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
};
|
||||||
|
|
||||||
const isFormValid = computed(() => {
|
const isFormValid = computed(() => {
|
||||||
const hasRequiredFields =
|
const hasRequiredFields =
|
||||||
formData.name.trim() &&
|
formData.name.trim() &&
|
||||||
@@ -1345,6 +1362,12 @@ const parseDebFileAndSearchHistory = async (debPath: string) => {
|
|||||||
JSON.stringify(formData, null, 2),
|
JSON.stringify(formData, null, 2),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const gitContributor = await getContributorFromGit();
|
||||||
|
if (gitContributor) {
|
||||||
|
formData.contributor = gitContributor;
|
||||||
|
console.log("[Submitter] Contributor updated from git:", gitContributor);
|
||||||
|
}
|
||||||
|
|
||||||
if (formData.pkgname) {
|
if (formData.pkgname) {
|
||||||
isSearchingHistory.value = true;
|
isSearchingHistory.value = true;
|
||||||
try {
|
try {
|
||||||
@@ -1460,7 +1483,9 @@ const selectArch = async (arch: HistoryArchInfo) => {
|
|||||||
|
|
||||||
formData.name = arch.name || formData.name;
|
formData.name = arch.name || formData.name;
|
||||||
formData.author = arch.author || formData.author;
|
formData.author = arch.author || formData.author;
|
||||||
formData.contributor = arch.contributor || formData.contributor;
|
if (!formData.contributor) {
|
||||||
|
formData.contributor = arch.contributor || "";
|
||||||
|
}
|
||||||
formData.website = arch.website || formData.website;
|
formData.website = arch.website || formData.website;
|
||||||
formData.category = arch.category || formData.category;
|
formData.category = arch.category || formData.category;
|
||||||
formData.description = arch.more || formData.description;
|
formData.description = arch.more || formData.description;
|
||||||
|
|||||||
Reference in New Issue
Block a user