mirror of
https://github.com/msojocs/wechat-web-devtools-linux.git
synced 2025-07-22 00:00:04 +08:00
feat: appimage cli
This commit is contained in:
parent
87d6149780
commit
484f25b953
2
.github/ISSUE_TEMPLATE/bug_report_cn.md
vendored
2
.github/ISSUE_TEMPLATE/bug_report_cn.md
vendored
@ -8,7 +8,7 @@ assignees: ''
|
|||||||
---
|
---
|
||||||
|
|
||||||
**预先准备**
|
**预先准备**
|
||||||
1. 删除`~/.config/wechat_devtools`目录,重新打开项目(若发布`issue`即默认阁下执行了此操作且问题没有解决);
|
1. 删除`~/.config/wechat-devtools`目录,重新打开项目(若发布`issue`即默认阁下执行了此操作且问题没有解决);
|
||||||
2. HelloWorld是否正常(登录状态新建默认项目,执行复现步骤):正常/不正常
|
2. HelloWorld是否正常(登录状态新建默认项目,执行复现步骤):正常/不正常
|
||||||
|
|
||||||
**问题描述**
|
**问题描述**
|
||||||
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -17,4 +17,5 @@ wcsc.bin
|
|||||||
temp.sh
|
temp.sh
|
||||||
# flatpak
|
# flatpak
|
||||||
.flatpak-builder
|
.flatpak-builder
|
||||||
build-dir
|
build-dir
|
||||||
|
__pycache__
|
@ -14,4 +14,6 @@ export WECHAT_DEVTOOLS_DIR="$root_dir/nwjs"
|
|||||||
export APPDATA="$root_dir/nwjs"
|
export APPDATA="$root_dir/nwjs"
|
||||||
export PATH="$root_dir/wine:$root_dir/node/bin:$root_dir/nwjs:$PATH"
|
export PATH="$root_dir/wine:$root_dir/node/bin:$root_dir/nwjs:$PATH"
|
||||||
|
|
||||||
node $root_dir/package.nw/js/common/cli/index.js "$@"
|
# node $root_dir/package.nw/js/common/cli/index.js "$@"
|
||||||
|
# const t=e.customScriptName?e.$0:o.basename(e.$0),
|
||||||
|
echo "process.argv[1]='$root_dir/bin/wechat-devtools-cli';require('$root_dir/package.nw/js/common/cli/index.js')" | node - "$@"
|
||||||
|
@ -1,44 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!-- Copyright 2022 msojocs <jiyecafe@email.com> -->
|
|
||||||
<component type="desktop-application">
|
|
||||||
<id>io.github.msojocs.wechat_devtools</id>
|
|
||||||
<metadata_license>MIT</metadata_license>
|
|
||||||
<project_license>MIT</project_license>
|
|
||||||
<name>WeChat Dev Tools</name>
|
|
||||||
<summary>WeChat Dev Tools For Linux </summary>
|
|
||||||
|
|
||||||
<description>
|
|
||||||
<p>
|
|
||||||
WeChat Dev Tools For Linux. 微信开发者工具Linux版
|
|
||||||
WeChat Dev Tools For Linux. 微信开发者工具Linux版
|
|
||||||
WeChat Dev Tools For Linux. 微信开发者工具Linux版
|
|
||||||
</p>
|
|
||||||
<p>微信开发者工具Linux版</p>
|
|
||||||
</description>
|
|
||||||
|
|
||||||
<launchable type="desktop-id">io.github.msojocs.wechat_devtools.desktop</launchable>
|
|
||||||
|
|
||||||
<screenshots>
|
|
||||||
<screenshot type="default">
|
|
||||||
<caption>Main Page</caption>
|
|
||||||
<image>https://raw.githubusercontents.com/msojocs/wechat-web-devtools-linux/master/res/screenshots/1.05.2201240.png</image>
|
|
||||||
</screenshot>
|
|
||||||
</screenshots>
|
|
||||||
|
|
||||||
<url type="homepage">https://github.com/msojocs/wechat-web-devtools-linux</url>
|
|
||||||
<project_group>msojocs</project_group>
|
|
||||||
|
|
||||||
<content_rating/>
|
|
||||||
|
|
||||||
<provides>
|
|
||||||
<binary>wechat-web-devtools-linux</binary>
|
|
||||||
</provides>
|
|
||||||
|
|
||||||
<releases>
|
|
||||||
<release version="0.23" date="2022-03-05">
|
|
||||||
<description>
|
|
||||||
<p>Upgrade: 升级工具版本至 1.05.2203030</p>
|
|
||||||
</description>
|
|
||||||
</release>
|
|
||||||
</releases>
|
|
||||||
</component>
|
|
10
test/miniumT.py
Normal file
10
test/miniumT.py
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
#-- coding: UTF-8 --
|
||||||
|
import minium
|
||||||
|
# print(minium)
|
||||||
|
mini = minium.Minium({
|
||||||
|
"project_path": r"/home/msojocs/Documents/we1", #小程序项目路径
|
||||||
|
"dev_tool_path": r"/mnt/disk2/wechat-web-devtools-linux/bin/wechat-devtools-cli",#开发者工具的命令行工具路径
|
||||||
|
"test_port": 9420 #minitest自动化端口
|
||||||
|
})
|
||||||
|
print(mini.get_system_info())#输出开发者工具模拟器的信息
|
@ -1,5 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# 构建AppImage
|
||||||
|
|
||||||
# 参数:
|
# 参数:
|
||||||
# $1 - 版本 v1.05.2203030-2
|
# $1 - 版本 v1.05.2203030-2
|
||||||
# $2 - 平台 x86_64
|
# $2 - 平台 x86_64
|
||||||
@ -52,7 +54,7 @@ notice "下载AppImage构建工具 ACTION_MODE:$ACTION_MODE"
|
|||||||
if [[ $ACTION_MODE == 'true' ]]; then
|
if [[ $ACTION_MODE == 'true' ]]; then
|
||||||
appimagetool_host="github.com"
|
appimagetool_host="github.com"
|
||||||
else
|
else
|
||||||
appimagetool_host="download.fastgit.org"
|
appimagetool_host="github.rc1844.workers.dev"
|
||||||
fi
|
fi
|
||||||
if [ ! -f "$tmp_dir/appimagetool-x86_64.AppImage" ];then
|
if [ ! -f "$tmp_dir/appimagetool-x86_64.AppImage" ];then
|
||||||
wget "https://$appimagetool_host/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage" \
|
wget "https://$appimagetool_host/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage" \
|
||||||
@ -69,13 +71,18 @@ mkdir -p $app_dir/usr/share/{metainfo,icons}
|
|||||||
|
|
||||||
notice "COPY FILES"
|
notice "COPY FILES"
|
||||||
cp "$root_dir/bin/wechat-devtools" "$app_dir/bin/wechat-devtools"
|
cp "$root_dir/bin/wechat-devtools" "$app_dir/bin/wechat-devtools"
|
||||||
|
cp "$root_dir/bin/wechat-devtools-cli" "$app_dir/bin/wechat-devtools-cli"
|
||||||
cp "$root_dir/res/icons/wechat-devtools.png" "$app_dir/wechat-devtools.png"
|
cp "$root_dir/res/icons/wechat-devtools.png" "$app_dir/wechat-devtools.png"
|
||||||
\cp -rf "$root_dir/res/appimage"/* "$app_dir"
|
\cp -rf "$root_dir/res/appimage"/* "$app_dir"
|
||||||
cp $app_dir/usr/share/applications/*.desktop "$app_dir/io.github.msojocs.wechat_devtools.desktop"
|
cp $app_dir/usr/share/applications/*.desktop "$app_dir/io.github.msojocs.wechat_devtools.desktop"
|
||||||
|
|
||||||
cat > "$app_dir/AppRun" <<- EOF
|
cat > "$app_dir/AppRun" <<- 'EOF'
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
exec \$APPDIR/bin/wechat-devtools
|
if [[ $1 == 'cli' ]];then
|
||||||
|
exec $APPDIR/bin/wechat-devtools-cli ${@:2}
|
||||||
|
else
|
||||||
|
exec $APPDIR/bin/wechat-devtools
|
||||||
|
fi
|
||||||
EOF
|
EOF
|
||||||
chmod +x "$app_dir/AppRun"
|
chmod +x "$app_dir/AppRun"
|
||||||
|
|
||||||
|
@ -1,73 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# 参数:
|
|
||||||
# $1 - 版本 v1.05.2203030-2
|
|
||||||
# $2 - 平台 x86_64
|
|
||||||
|
|
||||||
set -e
|
|
||||||
notice() {
|
|
||||||
echo -e "\033[36m $1 \033[0m "
|
|
||||||
}
|
|
||||||
fail() {
|
|
||||||
echo -e "\033[41;37m 失败 \033[0m $1"
|
|
||||||
}
|
|
||||||
|
|
||||||
if [ -n "$1" ];then
|
|
||||||
export VERSION=$1
|
|
||||||
fi
|
|
||||||
if [ -n "$2" ];then
|
|
||||||
export ARCH=$2
|
|
||||||
fi
|
|
||||||
|
|
||||||
root_dir=$(cd `dirname $0`/.. && pwd -P)
|
|
||||||
tmp_dir="$root_dir/tmp"
|
|
||||||
app_dir="$tmp_dir/Flatpak"
|
|
||||||
build_dir="$tmp_dir/build"
|
|
||||||
mkdir -p $build_dir
|
|
||||||
|
|
||||||
notice "检查版本号"
|
|
||||||
DEVTOOLS_VERSION=$( cat "$root_dir/package.nw/package.json" | grep -m 1 -Eo "\"[0-9]{1}\.[0-9]{2}\.[0-9]+" )
|
|
||||||
DEVTOOLS_VERSION="${DEVTOOLS_VERSION//\"/}"
|
|
||||||
INPUT_VERSION=$( echo $VERSION | sed 's/v//' | sed 's/-.*//' )
|
|
||||||
# if [[ "$INPUT_VERSION" != "$DEVTOOLS_VERSION" ]];then
|
|
||||||
# fail "传入版本号与实际版本号不一致!"
|
|
||||||
# exit 1
|
|
||||||
# fi
|
|
||||||
|
|
||||||
# Remove any previous build
|
|
||||||
rm -rf $app_dir
|
|
||||||
# Make usr and icons dirs
|
|
||||||
mkdir -p $app_dir/bin
|
|
||||||
|
|
||||||
notice "COPY FILES"
|
|
||||||
cp "$root_dir/bin/wechat-devtools" "$app_dir/bin/wechat-devtools"
|
|
||||||
cp "$root_dir/res/icons/wechat-devtools.svg" "$app_dir/io.github.msojocs.wechat_devtools.svg"
|
|
||||||
\cp -rf "$root_dir/res/flatpak"/* "$app_dir"
|
|
||||||
cp $root_dir/res/template.desktop "$app_dir/io.github.msojocs.wechat_devtools.desktop"
|
|
||||||
sed -i 's/Icon=dir\/res\/icons\/wechat-devtools.svg/Icon=io.github.msojocs.wechat_devtools/' "$app_dir/io.github.msojocs.wechat_devtools.desktop"
|
|
||||||
sed -i 's/Exec=dir\/bin\/wechat-devtools/Exec=startup/' "$app_dir/io.github.msojocs.wechat_devtools.desktop"
|
|
||||||
cp -r "$root_dir/package.nw" "$app_dir/package.nw"
|
|
||||||
cp -r "$root_dir/nwjs" "$app_dir/nwjs"
|
|
||||||
if [ -f $root_dir/node/bin/node ];then
|
|
||||||
rm -rf "$app_dir/nwjs/node" "$app_dir/nwjs/node.exe"
|
|
||||||
cp "$root_dir/node/bin/node" "$app_dir/nwjs/node"
|
|
||||||
cd "$app_dir/nwjs/" && ln -s "node" "node.exe"
|
|
||||||
fi
|
|
||||||
|
|
||||||
notice "MAKE FLATPAK"
|
|
||||||
|
|
||||||
cd $app_dir
|
|
||||||
|
|
||||||
# 此处关键参照 https://unix.stackexchange.com/questions/412869/how-to-allow-gui-application-in-flatpak-to-run-cli-tool
|
|
||||||
cat > startup.sh <<- 'EOF'
|
|
||||||
#!/bin/sh
|
|
||||||
export PATH="/var/run/host/usr/bin:$PATH"
|
|
||||||
export LD_LIBRARY_PATH="/app/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH"
|
|
||||||
exec /app/opt/bin/wechat-devtools
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# flatpak-builder build-dir io.github.msojocs.wechat-devtools.yml --force-clean
|
|
||||||
|
|
||||||
flatpak-builder build-dir io.github.msojocs.wechat-devtools.yml --force-clean --install --user
|
|
||||||
|
|
||||||
flatpak run io.github.msojocs.wechat-devtools
|
|
@ -1,5 +1,8 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# 用于github actions构建
|
||||||
|
# 解压初步构建后的文件
|
||||||
|
|
||||||
# 脚本执行前提,已完成支持wine的基本构建
|
# 脚本执行前提,已完成支持wine的基本构建
|
||||||
set -e
|
set -e
|
||||||
success() {
|
success() {
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# 打包成tar.gz & 构建AppImage
|
||||||
|
|
||||||
# 参数:
|
# 参数:
|
||||||
# $1 - 版本 v1.05.2203030-2
|
# $1 - 版本 v1.05.2203030-2
|
||||||
# $2 - 平台 x86_64
|
# $2 - 平台 x86_64
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# 打包成tar.gz
|
||||||
|
|
||||||
# 参数:
|
# 参数:
|
||||||
# $1 - 版本 v1.05.2203030-2
|
# $1 - 版本 v1.05.2203030-2
|
||||||
# $2 - 平台 x86_64
|
# $2 - 平台 x86_64
|
||||||
|
Loading…
x
Reference in New Issue
Block a user