diff --git a/.github/workflows/pake-cli.yaml b/.github/workflows/pake-cli.yaml index 93b4249..ad00b9b 100644 --- a/.github/workflows/pake-cli.yaml +++ b/.github/workflows/pake-cli.yaml @@ -8,9 +8,9 @@ on: default: "macos-latest" type: choice options: - - "windows-latest" - - "macos-latest" - - "ubuntu-20.04" + - "windows-latest" + - "macos-latest" + - "ubuntu-20.04" url: description: "[URL]" required: true @@ -44,9 +44,9 @@ on: default: "deb" type: choice options: - - "deb" - - "appimage" - - "all" + - "deb" + - "appimage" + - "all" jobs: @@ -57,71 +57,91 @@ jobs: fail-fast: false steps: - - name: Checkout repository - uses: actions/checkout@v3 + - name: Checkout repository + uses: actions/checkout@v3 - - name: install node - uses: actions/setup-node@v3 - with: - node-version: 18 + - name: install node + uses: actions/setup-node@v3 + with: + node-version: 18 - - name: Install Rust for ubuntu-20.04 - if: inputs.platform == 'ubuntu-20.04' - uses: dtolnay/rust-toolchain@stable - with: - toolchain: stable - target: x86_64-unknown-linux-musl + - name: Install Rust for ubuntu-20.04 + if: inputs.platform == 'ubuntu-20.04' + uses: dtolnay/rust-toolchain@stable + with: + toolchain: stable + target: x86_64-unknown-linux-musl - - name: Install Rust for windows-latest - if: inputs.platform == 'windows-latest' - uses: dtolnay/rust-toolchain@stable - with: - toolchain: stable-x86_64-msvc - target: x86_64-pc-windows-msvc + - name: Install Rust for windows-latest + if: inputs.platform == 'windows-latest' + uses: dtolnay/rust-toolchain@stable + with: + toolchain: stable-x86_64-msvc + target: x86_64-pc-windows-msvc - - name: Install Rust for macos-latest - if: inputs.platform == 'macos-latest' - uses: dtolnay/rust-toolchain@stable - with: - toolchain: stable - target: x86_64-apple-darwin + - name: Install Rust for macos-latest + if: inputs.platform == 'macos-latest' + uses: dtolnay/rust-toolchain@stable + with: + toolchain: stable + target: x86_64-apple-darwin - - name: install dependencies (ubuntu only) - if: inputs.platform == 'ubuntu-20.04' - uses: awalsh128/cache-apt-pkgs-action@latest - with: - packages: libwebkit2gtk-4.0-dev build-essential curl wget libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev gnome-video-effects gnome-video-effects-extra - version: 1.1 + - name: install dependencies (ubuntu only) + if: inputs.platform == 'ubuntu-20.04' + uses: awalsh128/cache-apt-pkgs-action@latest + with: + packages: libwebkit2gtk-4.0-dev build-essential curl wget libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev gnome-video-effects gnome-video-effects-extra + version: 1.1 - - name: install pake-cli local - shell: bash - run: | - echo "install pake on local" - npm install pake-cli + - name: install pake-cli local + shell: bash + run: | + echo "install pake on local" + npm install pake-cli - - name: rust cache - uses: Swatinem/rust-cache@v2 + - name: rust cache restore + uses: actions/cache/restore@v3 + id: cache_store + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + node_modules/pake-cli/src-tauri/target/ + key: ${{ inputs.platform }}-cargo-${{ hashFiles('node_modules/pake-cli/src-tauri/Cargo.lock') }} - - name: build with pake-cli - shell: pwsh - run: | - pwsh ./script/build_with_pake_cli.ps1 - env: - URL: ${{ inputs.url }} - NAME: ${{ inputs.name }} - ICON: ${{ inputs.icon }} - HEIGHT: ${{ inputs.height }} - WIDTH: ${{ inputs.width }} - TRANSPARENT: ${{ inputs.transparent }} - FULLSCREEN: ${{ inputs.fullscreen }} - RESIZE: ${{ inputs.resize }} - MULTI_ARCH: ${{ inputs.multi_arch }} - TARGETS: ${{ inputs.targets }} + - name: build with pake-cli + shell: pwsh + run: | + pwsh ./script/build_with_pake_cli.ps1 + env: + URL: ${{ inputs.url }} + NAME: ${{ inputs.name }} + ICON: ${{ inputs.icon }} + HEIGHT: ${{ inputs.height }} + WIDTH: ${{ inputs.width }} + TRANSPARENT: ${{ inputs.transparent }} + FULLSCREEN: ${{ inputs.fullscreen }} + RESIZE: ${{ inputs.resize }} + MULTI_ARCH: ${{ inputs.multi_arch }} + TARGETS: ${{ inputs.targets }} - - name: Upload archive - uses: actions/upload-artifact@v3 - with: - name: output-${{ inputs.platform }}.zip - path: node_modules/pake-cli/output/* - retention-days: 3 - \ No newline at end of file + - name: Upload archive + uses: actions/upload-artifact@v3 + with: + name: output-${{ inputs.platform }}.zip + path: node_modules/pake-cli/output/* + retention-days: 3 + + - name: rust cache store + uses: actions/cache/save@v3 + if: steps.cache_store.outputs.cache-hit != 'true' + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + node_modules/pake-cli/src-tauri/target/ + key: ${{ inputs.platform }}-cargo-${{ hashFiles('node_modules/pake-cli/src-tauri/Cargo.lock') }} diff --git a/.github/workflows/pake_build.yaml b/.github/workflows/pake_build.yaml index 044a411..c22d3f4 100644 --- a/.github/workflows/pake_build.yaml +++ b/.github/workflows/pake_build.yaml @@ -13,57 +13,73 @@ jobs: matrix: build: [linux, windows, macos] include: - - build: linux - os: ubuntu-20.04 - rust: stable - target: x86_64-unknown-linux-musl - - build: windows - os: windows-latest - rust: stable-x86_64-msvc - target: x86_64-pc-windows-msvc - - build: macos - os: macos-latest - rust: stable - target: x86_64-apple-darwin + - build: linux + os: ubuntu-20.04 + rust: stable + target: x86_64-unknown-linux-musl + - build: windows + os: windows-latest + rust: stable-x86_64-msvc + target: x86_64-pc-windows-msvc + - build: macos + os: macos-latest + rust: stable + target: x86_64-apple-darwin fail-fast: false steps: - - name: Checkout repository - uses: actions/checkout@v3 + - name: Checkout repository + uses: actions/checkout@v3 - - name: install node - uses: actions/setup-node@v3 - with: - node-version: 18 + - name: install node + uses: actions/setup-node@v3 + with: + node-version: 18 - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: ${{ matrix.rust }} - target: ${{ matrix.target }} + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ matrix.rust }} + target: ${{ matrix.target }} - - name: install dependencies (ubuntu only) - if: matrix.os == 'ubuntu-20.04' - uses: awalsh128/cache-apt-pkgs-action@latest - with: - packages: libwebkit2gtk-4.0-dev build-essential curl wget libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev gnome-video-effects gnome-video-effects-extra - version: 1.1 + - name: install dependencies (ubuntu only) + if: matrix.os == 'ubuntu-20.04' + uses: awalsh128/cache-apt-pkgs-action@latest + with: + packages: libwebkit2gtk-4.0-dev build-essential curl wget libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev gnome-video-effects gnome-video-effects-extra + version: 1.1 - - name: rust cache - uses: Swatinem/rust-cache@v2 + - name: rust cache restore + uses: actions/cache/restore@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + src-tauri/target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - - name: build for Ubuntu - if: matrix.os == 'ubuntu-20.04' - run: npm run build:all-unix + - name: build for Ubuntu + if: matrix.os == 'ubuntu-20.04' + run: npm run build:all-unix - - name: build for MacOS - if: matrix.os == 'macos-latest' - run: | - rustup target add aarch64-apple-darwin - npm run build:all-unix + - name: build for MacOS + if: matrix.os == 'macos-latest' + run: | + rustup target add aarch64-apple-darwin + npm run build:all-unix - - name: build for windows - if: matrix.os == 'windows-latest' - shell: pwsh - run: | - npm run build:all-windows + - name: build for windows + if: matrix.os == 'windows-latest' + shell: pwsh + run: | + npm run build:all-windows + + - name: Upload files + # arg info: https://github.com/ncipollo/release-action#release-action + uses: ncipollo/release-action@v1 + with: + allowUpdates: true + artifacts: "output/*/*.*" + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/pake_build_with_cache.yaml b/.github/workflows/pake_build_with_cache.yaml index aecfcee..cc6ddff 100644 --- a/.github/workflows/pake_build_with_cache.yaml +++ b/.github/workflows/pake_build_with_cache.yaml @@ -21,70 +21,91 @@ jobs: matrix: build: [linux, windows, macos] include: - - build: linux - os: ubuntu-20.04 - rust: stable - target: x86_64-unknown-linux-musl - # archive-name: target-linux.tar.gz - - build: windows - os: windows-latest - rust: stable-x86_64-msvc - target: x86_64-pc-windows-msvc - # archive-name: target-windows.tar.gz - - build: macos - os: macos-latest - rust: stable - target: x86_64-apple-darwin - # archive-name: target-macos.tar.gz + - build: linux + os: ubuntu-20.04 + rust: stable + target: x86_64-unknown-linux-musl + # archive-name: target-linux.tar.gz + - build: windows + os: windows-latest + rust: stable-x86_64-msvc + target: x86_64-pc-windows-msvc + # archive-name: target-windows.tar.gz + - build: macos + os: macos-latest + rust: stable + target: x86_64-apple-darwin + # archive-name: target-macos.tar.gz fail-fast: false steps: - - name: Checkout repository - uses: actions/checkout@v3 + - name: Checkout repository + uses: actions/checkout@v3 - - name: install node - uses: actions/setup-node@v3 - with: - node-version: 18 + - name: install node + uses: actions/setup-node@v3 + with: + node-version: 18 - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - toolchain: ${{ matrix.rust }} - target: ${{ matrix.target }} + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ matrix.rust }} + target: ${{ matrix.target }} - - name: install dependencies (ubuntu only) - if: matrix.os == 'ubuntu-20.04' - uses: awalsh128/cache-apt-pkgs-action@latest - with: - packages: libwebkit2gtk-4.0-dev build-essential curl wget libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev gnome-video-effects gnome-video-effects-extra - version: 1.1 + - name: install dependencies (ubuntu only) + if: matrix.os == 'ubuntu-20.04' + uses: awalsh128/cache-apt-pkgs-action@latest + with: + packages: libwebkit2gtk-4.0-dev build-essential curl wget libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev gnome-video-effects gnome-video-effects-extra + version: 1.1 - - name: rust cache - uses: Swatinem/rust-cache@v2 + - name: rust cache restore + uses: actions/cache/restore@v3 + id: cache_store + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + src-tauri/target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - - name: build for Ubuntu - if: matrix.os == 'ubuntu-20.04' - run: npm run build:all-unix + - name: build for Ubuntu + if: matrix.os == 'ubuntu-20.04' + run: npm run build:all-unix - - name: build for MacOS - if: matrix.os == 'macos-latest' - run: | - rustup target add aarch64-apple-darwin - npm run build:all-unix + - name: build for MacOS + if: matrix.os == 'macos-latest' + run: | + rustup target add aarch64-apple-darwin + npm run build:all-unix - - name: build for windows - if: matrix.os == 'windows-latest' - shell: pwsh - run: | - npm run build:all-windows + - name: build for windows + if: matrix.os == 'windows-latest' + shell: pwsh + run: | + npm run build:all-windows - - name: Upload files - # arg info: https://github.com/ncipollo/release-action#release-action - uses: ncipollo/release-action@v1 - with: - allowUpdates: true - prerelease: ${{ inputs.is_pre_release }} - artifacts: "output/*/*.*" - tag: ${{ inputs.version }} - token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + - name: Upload files + # arg info: https://github.com/ncipollo/release-action#release-action + uses: ncipollo/release-action@v1 + with: + allowUpdates: true + prerelease: ${{ inputs.is_pre_release }} + artifacts: "output/*/*.*" + tag: ${{ inputs.version }} + token: ${{ secrets.GITHUB_TOKEN }} + + - name: rust cache store + uses: actions/cache/save@v3 + if: steps.cache_store.outputs.cache-hit != 'true' + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + src-tauri/target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} diff --git a/README.md b/README.md index 61f05b5..9e0ee79 100644 --- a/README.md +++ b/README.md @@ -107,7 +107,7 @@ - + Flomo diff --git a/README_CN.md b/README_CN.md index 26325da..43ecd2f 100644 --- a/README_CN.md +++ b/README_CN.md @@ -3,7 +3,7 @@

Pake

-

很简单的用 Rust 打包网页生成很小的桌面App

+

利用 Rust 轻松构建轻量级多端桌面应用

twitter @@ -106,7 +106,7 @@ - + Flomo diff --git a/app.csv b/app.csv index a2ff863..ee95b96 100644 --- a/app.csv +++ b/app.csv @@ -1,7 +1,7 @@ name(Linux),name(Mac/Windows),name_zh,url programmusic,ProgramMusic,ProgramMusic,https://musicforprogramming.net/ twitter,Twitter,推特,https://twitter.com/ -youtube,YouTube,YouTube,https://youtube.com +youtube,YouTube,YouTube,https://www.youtube.com reference,Reference,Reference,https://quickref.me/zh-CN/ coderunner,CodeRunner,CodeRunner,https://riju.codes/ chatgpt,ChatGPT,ChatGPT,https://chat.openai.com/chat diff --git a/bin/helpers/rust.ts b/bin/helpers/rust.ts index bf53087..a6e74a9 100644 --- a/bin/helpers/rust.ts +++ b/bin/helpers/rust.ts @@ -7,8 +7,9 @@ import { shellExec } from '@/utils/shell'; import { isChinaDomain } from '@/utils/ip'; export async function installRust() { + const isActions = process.env.GITHUB_ACTIONS; const isInChina = await isChinaDomain('sh.rustup.rs'); - const rustInstallScriptForMac = isInChina + const rustInstallScriptForMac = isInChina && !isActions ? 'export RUSTUP_DIST_SERVER="https://rsproxy.cn" && export RUSTUP_UPDATE_ROOT="https://rsproxy.cn/rustup" && curl --proto "=https" --tlsv1.2 -sSf https://rsproxy.cn/rustup-init.sh | sh' : "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y"; const rustInstallScriptForWindows = 'winget install --id Rustlang.Rustup'; diff --git a/bin/options/icon.ts b/bin/options/icon.ts index 6ee54e6..55c8c23 100644 --- a/bin/options/icon.ts +++ b/bin/options/icon.ts @@ -45,7 +45,14 @@ export async function downloadIcon(iconUrl: string) { } const { path: tempPath } = await dir(); - const iconPath = `${tempPath}/icon.${fileDetails.ext}`; + let iconPath = `${tempPath}/icon.${fileDetails.ext}`; + // Fix this for linux + if (IS_LINUX) { + iconPath = 'png/linux_temp.png'; + await fsExtra.outputFile(`${npmDirectory}/src-tauri/${iconPath}`, iconData); + } else { + await fsExtra.outputFile(iconPath, iconData); + } await fsExtra.outputFile(iconPath, iconData); spinner.succeed(chalk.green('Icon downloaded successfully!')); return iconPath; diff --git a/dist/cli.js b/dist/cli.js index 0b2e745..db315f4 100644 --- a/dist/cli.js +++ b/dist/cli.js @@ -11,16 +11,16 @@ import { fileURLToPath } from 'url'; import dns from 'dns'; import http from 'http'; import { promisify } from 'util'; -import fs from 'fs'; import updateNotifier from 'update-notifier'; import axios from 'axios'; import { dir } from 'tmp-promise'; import { fileTypeFromBuffer } from 'file-type'; import psl from 'psl'; import isUrl from 'is-url'; +import fs from 'fs'; var name = "pake-cli"; -var version = "2.2.0"; +var version = "2.2.5"; var description = "🤱🏻 Turn any webpage into a desktop app with Rust. 🤱🏻 很简单的用 Rust 打包网页生成很小的桌面 App。"; var engines = { node: ">=16.0.0" @@ -53,14 +53,12 @@ var scripts = { start: "npm run dev", dev: "npm run tauri dev", build: "npm run tauri build --release", - "build:debug": "npm run tauri build -- --debug", "build:mac": "npm run tauri build -- --target universal-apple-darwin", "build:all-unix": "chmod +x ./script/build.sh && ./script/build.sh", "build:all-windows": "pwsh ./script/build.ps1", analyze: "cd src-tauri && cargo bloat --release --crates", tauri: "tauri", cli: "rollup -c rollup.config.js --watch", - "cli:dev": "cross-env NODE_ENV=development rollup -c rollup.config.js -w", "cli:build": "cross-env NODE_ENV=production rollup -c rollup.config.js", prepublishOnly: "npm run cli:build" }; @@ -88,7 +86,6 @@ var devDependencies = { "@rollup/plugin-alias": "^4.0.2", "@rollup/plugin-commonjs": "^23.0.2", "@rollup/plugin-json": "^5.0.2", - "@rollup/plugin-replace": "^5.0.2", "@rollup/plugin-terser": "^0.1.0", "@types/fs-extra": "^9.0.13", "@types/is-url": "^1.2.30", @@ -126,7 +123,7 @@ var packageJson = { var windows = [ { url: "https://weread.qq.com/", - transparent: false, + transparent: true, fullscreen: false, width: 1200, height: 780, @@ -140,7 +137,7 @@ var user_agent = { windows: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36" }; var menu = { - macos: false, + macos: true, linux: false, windows: false }; @@ -149,14 +146,11 @@ var system_tray = { linux: true, windows: true }; -var inject = [ -]; var pakeConf = { windows: windows, user_agent: user_agent, menu: menu, - system_tray: system_tray, - inject: inject + system_tray: system_tray }; var tauri$3 = { @@ -176,7 +170,7 @@ var tauri$3 = { active: false }, systemTray: { - iconPath: "png/icon_512.png", + iconPath: "png/weread_512.png", iconAsTemplate: true }, allowlist: { @@ -197,11 +191,11 @@ var build = { beforeDevCommand: "" }; var CommonConf = { - tauri: tauri$3, "package": { productName: "WeRead", version: "1.0.0" }, + tauri: tauri$3, build: build }; @@ -245,9 +239,9 @@ var WinConf = { var tauri$1 = { bundle: { icon: [ - "icons/icon.icns" + "icons/weread.icns" ], - identifier: "com.pake.5b8ae9", + identifier: "com.pake.weread", active: true, category: "DeveloperTool", copyright: "", @@ -443,8 +437,9 @@ async function isChinaIP(ip, domain) { } async function installRust() { + const isActions = process.env.GITHUB_ACTIONS; const isInChina = await isChinaDomain('sh.rustup.rs'); - const rustInstallScriptForMac = isInChina + const rustInstallScriptForMac = isInChina && !isActions ? 'export RUSTUP_DIST_SERVER="https://rsproxy.cn" && export RUSTUP_UPDATE_ROOT="https://rsproxy.cn/rustup" && curl --proto "=https" --tlsv1.2 -sSf https://rsproxy.cn/rustup-init.sh | sh' : "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y"; const rustInstallScriptForWindows = 'winget install --id Rustlang.Rustup'; @@ -876,7 +871,15 @@ async function downloadIcon(iconUrl) { return null; } const { path: tempPath } = await dir(); - const iconPath = `${tempPath}/icon.${fileDetails.ext}`; + let iconPath = `${tempPath}/icon.${fileDetails.ext}`; + // Fix this for linux + if (IS_LINUX) { + iconPath = 'png/linux_temp.png'; + await fsExtra.outputFile(`${npmDirectory}/src-tauri/${iconPath}`, iconData); + } + else { + await fsExtra.outputFile(iconPath, iconData); + } await fsExtra.outputFile(iconPath, iconData); spinner.succeed(chalk.green('Icon downloaded successfully!')); return iconPath; diff --git a/package.json b/package.json index f641bee..361ea81 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "pake-cli", - "version": "2.2.0", - "description": "🤱🏻 Turn any webpage into a desktop app with Rust. 🤱🏻 很简单的用 Rust 打包网页生成很小的桌面 App。", + "version": "2.2.5", + "description": "🤱🏻 Turn any webpage into a desktop app with Rust. 🤱🏻 利用 Rust 轻松构建轻量级多端桌面应用。", "engines": { "node": ">=16.0.0" }, diff --git a/script/build.ps1 b/script/build.ps1 index 03747cd..5fa9c46 100644 --- a/script/build.ps1 +++ b/script/build.ps1 @@ -39,6 +39,7 @@ $total = $total - 1 # for windows, we need replace package name to title ForEach ($line in (Get-Content -Path .\app.csv | Select-Object -Skip 1)) { $name, $title, $name_zh, $url = $line.Split(",") + $domain = ([Uri]$url).Host Write-Host "building package ${index}/${total}" Write-Host "package name is ${name} ${name_zh}" Write-Host "==========================" @@ -54,6 +55,9 @@ ForEach ($line in (Get-Content -Path .\app.csv | Select-Object -Skip 1)) { # replace url with no regex (Get-Content -Path $pake_conf_path -Raw) | ForEach-Object { $_.Replace('"url": ""', "`"url`": `"${url}`"") } | Set-Content $pake_conf_path + # -- replace domain -- # + (Get-Content -Path $common_conf_path -Raw) -replace '"domain":\s*"[^"]*"', '"domain": ""' | Set-Content -Path $common_conf_path + (Get-Content -Path $common_conf_path -Raw) | ForEach-Object { $_.Replace('"domain": ""', "`"domain`": `"${domain}`"") } | Set-Content $common_conf_path # -- replace package name -- # # clear package_name with regex diff --git a/script/build.sh b/script/build.sh index bc27133..a353f93 100755 --- a/script/build.sh +++ b/script/build.sh @@ -59,6 +59,8 @@ do package_title=${arr[1]} package_zh_name=${arr[2]} url=${arr[3]} + domain=${url//http*:\/\//} + domain=${domain%%/*} # replace package info # clear url with regex @@ -66,6 +68,10 @@ do # replace url with no regex $sd -s "\"url\": \"\"," "\"url\": \"${url}\"," src-tauri/pake.json + # replace dangerousRemoteDomainIpcAccess domain + $sd "\"domain\": \"(.*?)\"," "\"domain\": \"\"," src-tauri/tauri.conf.json + $sd -s "\"domain\": \"\"," "\"domain\": \"${domain}\"," src-tauri/tauri.conf.json + # for apple, need replace title if [[ "$OSTYPE" =~ ^darwin ]]; then # update icon @@ -145,7 +151,7 @@ do $sd "Icon=.*" "Icon=" "${new_desktop}" $sd "Name=.*" "Name=" "${new_desktop}" $sd "Name\[zh_CN\]=.*" "Name[zh_CN]=" "${new_desktop}" - # repleace dekstop content with no reg + # replace desktop content with no reg $sd -s "Exec=" "Exec=${package_prefix}-${package_name}" "${new_desktop}" $sd -s "Icon=" "Icon=${package_prefix}-${package_name}" "${new_desktop}" $sd -s "Name=" "Name=${package_title}" "${new_desktop}" diff --git a/src-tauri/src/app/invoke.rs b/src-tauri/src/app/invoke.rs index 6dd2082..2cf8c6f 100644 --- a/src-tauri/src/app/invoke.rs +++ b/src-tauri/src/app/invoke.rs @@ -1,9 +1,8 @@ -use std::fs; -use crate::util::{check_file_or_append, get_download_message, MessageType, show_toast}; -use tauri::{api, command, AppHandle, Manager, Window}; -use tauri::api::http::{ClientBuilder, HttpRequestBuilder, ResponseType}; +use crate::util::{check_file_or_append, get_download_message, show_toast, MessageType}; use std::fs::File; use std::io::Write; +use tauri::api::http::{ClientBuilder, HttpRequestBuilder, ResponseType}; +use tauri::{api, command, AppHandle, Manager, Window}; #[derive(serde::Deserialize)] pub struct DownloadFileParams { @@ -26,11 +25,13 @@ pub async fn download_file(app: AppHandle, params: DownloadFileParams) -> Result let file_path = check_file_or_append(output_path.to_str().unwrap()); let client = ClientBuilder::new().build().unwrap(); - let response = client.send( - HttpRequestBuilder::new("GET", ¶ms.url) - .unwrap() - .response_type(ResponseType::Binary) - ).await; + let response = client + .send( + HttpRequestBuilder::new("GET", ¶ms.url) + .unwrap() + .response_type(ResponseType::Binary), + ) + .await; match response { Ok(res) => { diff --git a/src-tauri/src/inject/style.js b/src-tauri/src/inject/style.js index 9792638..5baccf8 100644 --- a/src-tauri/src/inject/style.js +++ b/src-tauri/src/inject/style.js @@ -180,6 +180,11 @@ window.addEventListener('DOMContentLoaded', _event => { visibility: hidden !important; } + #__next > div.overflow-hidden.w-full.h-full .absolute.bottom-0.left-0.w-full > div.text-center.text-xs { + visibility: hidden !important; + height: 0px !important; + } + #react-root [data-testid="primaryColumn"] > div > div { position: relative !important; } diff --git a/src-tauri/tauri.linux.conf.json b/src-tauri/tauri.linux.conf.json index 8c8eef0..df90475 100644 --- a/src-tauri/tauri.linux.conf.json +++ b/src-tauri/tauri.linux.conf.json @@ -8,9 +8,7 @@ "copyright": "", "deb": { "depends": ["curl", "wget"], - "files": { - "/usr/share/applications/com-pake-weread.desktop": "assets/com-pake-weread.desktop" - } + "files": {"/usr/share/applications/com-pake-weread.desktop": "assets/com-pake-weread.desktop"} }, "externalBin": [], "longDescription": "",