标准化命名

This commit is contained in:
辉鸭蛋
2024-12-29 23:22:41 +08:00
parent 1594103e0b
commit 3e2d1db129
64 changed files with 23 additions and 7 deletions

View File

@@ -1,3 +1,5 @@
// 这个脚本每次原神更新使用一次
const fs = require('fs');
const path = require('path');
@@ -18,16 +20,20 @@ if (!fs.existsSync(targetDir)) {
fs.readdirSync(sourceDir).forEach(file => {
const fileName = path.parse(file).name; // 获取文件名(不含扩展名)
// 在JSON数据中查找匹配项
const matchedItem = jsonData.find(item => item.Icon === fileName);
// 查找所有匹配项
const matchedItems = jsonData.filter(item => item.Icon === fileName);
if (matchedItem) {
if (matchedItems.length > 0) {
const sourcePath = path.join(sourceDir, file);
const targetPath = path.join(targetDir, `${matchedItem.Name}.png`);
// 复制并重命名文件
fs.copyFileSync(sourcePath, targetPath);
console.log(`已复制并重命名: ${file} -> ${matchedItem.Name}.png`);
// 为每个匹配项创建文件
matchedItems.forEach(matchedItem => {
const targetPath = path.join(targetDir, `${matchedItem.Name}.png`);
// 复制并重命名文件
fs.copyFileSync(sourcePath, targetPath);
console.log(`已复制并重命名: ${file} -> ${matchedItem.Name}.png`);
});
}
});

View File

@@ -1,3 +1,5 @@
// 这个脚本,有新的脚本目录就要使用
const fs = require('fs');
const path = require('path');

View File

@@ -1,3 +1,5 @@
// 用于给每个脚本目录添加icon
const fs = require('fs');
const path = require('path');
const { exec } = require('child_process');

View File

@@ -1,3 +1,5 @@
// 只找新的png文件然后复制到diffPng目录
const fs = require('fs');
const path = require('path');

View File

@@ -0,0 +1,2 @@
[.ShellClassInfo]
IconResource=icon.ico

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

View File

@@ -0,0 +1,2 @@
[.ShellClassInfo]
IconResource=icon.ico

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB