You've already forked gitea-banana-theme
主题更名为banana
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import { execSync } from "node:child_process";
|
||||
import crypto from "node:crypto";
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
@@ -52,10 +51,10 @@ export function themeInput(outDir: string, themeDir: string, mode: string): { [k
|
||||
|
||||
function giteaThemeMetaInfo(nameGroup: string[]): string {
|
||||
const displayName = nameGroup.map(word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(" ");
|
||||
return `gitea-theme-meta-info{--theme-display-name:"Nanobanana ${displayName}";}`; // 不要省略分号, 也不要追加任何变量, 否则 Gitea 不识别
|
||||
return `gitea-theme-meta-info{--theme-display-name:"banana ${displayName}";}`; // 不要省略分号, 也不要追加任何变量, 否则 Gitea 不识别
|
||||
}
|
||||
|
||||
const prefix = "theme-nanobanana-";
|
||||
const prefix = "theme-banana-";
|
||||
|
||||
/**
|
||||
* 生成主题文件
|
||||
@@ -116,24 +115,5 @@ export function themePlugin(): Plugin {
|
||||
}
|
||||
}
|
||||
},
|
||||
writeBundle() {
|
||||
// 上传到服务器
|
||||
const server = process.env.SSH_SERVER;
|
||||
const user = process.env.SSH_USER || "root";
|
||||
const theme_path = process.env.GITEA_THEME_PATH;
|
||||
if (server && theme_path) {
|
||||
const cmd = `scp dist/${prefix}*.css ${user}@${server}:${theme_path}`;
|
||||
console.log("[themePlugin] exec:", cmd);
|
||||
try {
|
||||
execSync(cmd, { stdio: "inherit" });
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
} catch (_) {
|
||||
// continue regardless of error
|
||||
}
|
||||
} else {
|
||||
console.log("[themePlugin] no SSH_SERVER or GITEA_THEME_PATH, skip upload");
|
||||
}
|
||||
console.log("[themePlugin] exec end.");
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user