perf: 图标安装方式变更为shell

This commit is contained in:
msojocs 2023-01-17 22:42:20 +08:00
parent 43cea86b7a
commit 0447f18b42
4 changed files with 41 additions and 63 deletions

View File

@ -31,22 +31,22 @@ jobs:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Prepare
run: |
yum install -y p7zip p7zip-plugins nodejs
cd compiler && npm install
cat /etc/issue
7z
# Docker is required by the docker/setup-qemu-action which enables emulation
- name: Install deps
run: |
dnf -y install docker
- uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v4
env:
ACTION_MODE: true
with:
bundle: wechat-devtools.flatpak
manifest-path: io.github.msojocs.wechat-devtools.yml
cache-key: flatpak-builder-${{ github.sha }}
cache: false
arch: ${{ matrix.arch }}
# - name: Prepare
# run: |
# yum install -y p7zip p7zip-plugins nodejs
# cd compiler && npm install
# cat /etc/issue
# 7z
# # Docker is required by the docker/setup-qemu-action which enables emulation
# - name: Install deps
# run: |
# dnf -y install docker
# - uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v4
# env:
# ACTION_MODE: true
# with:
# bundle: wechat-devtools.flatpak
# manifest-path: io.github.msojocs.wechat-devtools.yml
# cache-key: flatpak-builder-${{ github.sha }}
# cache: false
# arch: ${{ matrix.arch }}

View File

@ -1,4 +1,8 @@
# 1.06.2209070-1 / 2022-09-
# 1.06.2209070-2 / 2023-01-
- fix: compiler not found
# 1.06.2209070-1 / 2022-09-09
- update: devtools to v1.06.2209070

17
tools/install-desktop-icon-bash Executable file
View File

@ -0,0 +1,17 @@
#!/bin/bash
root_dir=$(cd `dirname $0`/.. && pwd -P)
for size in "64" "128" "256" "512"; do
echo "size: $size"
install -Dm644 "$root_dir/res/icons/${size}x${size}.png" "${HOME}/.local/share/icons/hicolor/${size}x${size}/wechat-devtools.png"
done
# svg
svg_path="${HOME}/.local/share/icons/hicolor/scalable/wechat-devtools.svg"
install -Dm644 "$root_dir/res/icons/wechat-devtools.svg" "$svg_path"
# desktop
template_path="$root_dir/res/template.desktop"
install -Dm644 "$template_path" "$HOME/.local/share/applications/wechat-devtools.desktop"
sed -i 's#dir#'$root_dir'#g' "$HOME/.local/share/applications/wechat-devtools.desktop"

View File

@ -1,43 +0,0 @@
#!/usr/bin/env node
const path = require("path");
const fs = require("fs");
const os = require("os");
const { spawn } = require("child_process");
const { info } = require("console");
for (let size of ["64", "128", "256", "512"]) {
let iconPath =
os.homedir() +
`/.local/share/icons/hicolor/${size}x${size}/wechat-devtools.png`;
try {
fs.mkdirSync(path.dirname(iconPath));
} catch (error) {}
info(`Writing icon file ${iconPath}`);
fs.copyFileSync(
path.resolve(__dirname, "../res/icons", `${size}x${size}.png`),
iconPath
);
}
let svgPath =
os.homedir() + "/.local/share/icons/hicolor/scalable/wechat-devtools.svg";
try {
fs.mkdirSync(path.dirname(svgPath));
} catch (error) {}
info(`Writing icon file ${svgPath}`);
fs.copyFileSync(
path.resolve(__dirname, "../res/icons/wechat-devtools.svg"),
svgPath
);
let desktopCode = fs
.readFileSync(path.resolve(__dirname, "../res/template.desktop"), "utf8")
.replace(new RegExp("dir", "g"), path.resolve(__dirname, ".."));
desktopPath =
os.homedir() + "/.local/share/applications/wechat-devtools.desktop";
try {
fs.mkdirSync(path.dirname(desktopPath));
} catch (error) {}
info(`Writing desktop file ${desktopPath}`);
fs.writeFileSync(desktopPath, desktopCode);