标准化命名
This commit is contained in:
@@ -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`);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// 这个脚本,有新的脚本目录就要使用
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// 用于给每个脚本目录添加icon
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const { exec } = require('child_process');
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// 只找新的png文件,然后复制到diffPng目录
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
|
||||
2
repo/pathing/水晶块/desktop.ini
Normal file
2
repo/pathing/水晶块/desktop.ini
Normal file
@@ -0,0 +1,2 @@
|
||||
[.ShellClassInfo]
|
||||
IconResource=icon.ico
|
||||
BIN
repo/pathing/水晶块/icon.ico
Normal file
BIN
repo/pathing/水晶块/icon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 28 KiB |
2
repo/pathing/蒲公英籽/desktop.ini
Normal file
2
repo/pathing/蒲公英籽/desktop.ini
Normal file
@@ -0,0 +1,2 @@
|
||||
[.ShellClassInfo]
|
||||
IconResource=icon.ico
|
||||
BIN
repo/pathing/蒲公英籽/icon.ico
Normal file
BIN
repo/pathing/蒲公英籽/icon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 32 KiB |
Reference in New Issue
Block a user