wechat-web-devtools-linux/tools/old/install-desktop-icon

23 lines
1022 B
Plaintext

#!/usr/bin/env mew_js
for (let size of ["64", "128", "256", "512"]) {
let iconPath = @.fs.homePath(`.local/share/icons/hicolor/${size}x${size}/wechat-devtools.png`);
@.fs.makeDirs(@.fs.dirname(iconPath));
@info(`Writing icon file ${iconPath}`);
@.fs.copyFile.sync(@path(__dirname, "../res/icons", `wechat-devtools${size}.png`), iconPath);
}
let svgPath = @.fs.homePath(".local/share/icons/hicolor/scalable/wechat-devtools.svg");
@.fs.makeDirs(@.fs.dirname(svgPath));
@info(`Writing icon file ${svgPath}`);
@.fs.copyFile.sync(@path(__dirname, "../res/icons/wechat-devtools.svg"), svgPath);
let desktopCode = @.format(@.fs.readFile.sync(@path(__dirname, "../res/template.desktop"), "utf8"), {
"dir": (@path(__dirname, ".."))
});
desktopPath = @.fs.homePath(".local/share/applications/wechat-devtools.desktop");
@.fs.makeDirs(@.fs.dirname(desktopPath));
@info(`Writing desktop file ${desktopPath}`);
@.fs.writeFile.sync(desktopPath, desktopCode);