mirror of
https://github.com/neosubhamoy/neodlp.git
synced 2025-12-19 01:32:57 +05:30
ci: added binary downloader build script
This commit is contained in:
2
.gitattributes
vendored
2
.gitattributes
vendored
@@ -1,3 +1 @@
|
|||||||
* text=auto eol=lf
|
* text=auto eol=lf
|
||||||
|
|
||||||
src-tauri/binaries/* filter=lfs diff=lfs merge=lfs -text
|
|
||||||
18
.gitignore
vendored
18
.gitignore
vendored
@@ -1,3 +1,14 @@
|
|||||||
|
node_modules
|
||||||
|
dist
|
||||||
|
dist-ssr
|
||||||
|
*.local
|
||||||
|
.github/workflows/.secrets
|
||||||
|
/target/
|
||||||
|
src-tauri/binaries/*
|
||||||
|
!src-tauri/binaries/.gitkeep
|
||||||
|
src-tauri/resources/downloads/*
|
||||||
|
!src-tauri/resources/downloads/.gitkeep
|
||||||
|
|
||||||
# Logs
|
# Logs
|
||||||
logs
|
logs
|
||||||
*.log
|
*.log
|
||||||
@@ -7,13 +18,6 @@ yarn-error.log*
|
|||||||
pnpm-debug.log*
|
pnpm-debug.log*
|
||||||
lerna-debug.log*
|
lerna-debug.log*
|
||||||
|
|
||||||
node_modules
|
|
||||||
dist
|
|
||||||
dist-ssr
|
|
||||||
*.local
|
|
||||||
.github/workflows/.secrets
|
|
||||||
/target/
|
|
||||||
|
|
||||||
# Editor directories and files
|
# Editor directories and files
|
||||||
.vscode/*
|
.vscode/*
|
||||||
!.vscode/extensions.json
|
!.vscode/extensions.json
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
[lfs]
|
|
||||||
url = https://lfs.neosubhamoy.com
|
|
||||||
@@ -7,7 +7,8 @@
|
|||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"build": "tsc && vite build",
|
"build": "tsc && vite build",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
"tauri": "tauri"
|
"tauri": "tauri",
|
||||||
|
"download": "node ./scripts/download-bins.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@hookform/resolvers": "^5.2.2",
|
"@hookform/resolvers": "^5.2.2",
|
||||||
|
|||||||
443
scripts/download-bins.js
Normal file
443
scripts/download-bins.js
Normal file
@@ -0,0 +1,443 @@
|
|||||||
|
import os from 'os';
|
||||||
|
import fs from 'fs';
|
||||||
|
import path from 'path';
|
||||||
|
import { fileURLToPath } from 'url';
|
||||||
|
import { execSync } from 'child_process';
|
||||||
|
|
||||||
|
const __filename = fileURLToPath(import.meta.url);
|
||||||
|
const __dirname = path.dirname(__filename);
|
||||||
|
const projectRoot = path.resolve(__dirname, '..');
|
||||||
|
|
||||||
|
const downloadDir = path.join(projectRoot, 'src-tauri', 'resources', 'downloads');
|
||||||
|
const binDir = path.join(projectRoot, 'src-tauri', 'binaries');
|
||||||
|
|
||||||
|
const platform = os.platform();
|
||||||
|
const targetPlatform = process.argv[2];
|
||||||
|
const targetBin = process.argv[3];
|
||||||
|
|
||||||
|
const versions = {
|
||||||
|
'yt-dlp': 'latest',
|
||||||
|
'ffmpeg-ffprobe': 'latest',
|
||||||
|
'deno': 'latest',
|
||||||
|
'aria2c': '1.37.0',
|
||||||
|
};
|
||||||
|
|
||||||
|
const binaries = {
|
||||||
|
'yt-dlp': [
|
||||||
|
{
|
||||||
|
name: 'yt-dlp-x86_64-pc-windows-msvc',
|
||||||
|
platform: 'win32',
|
||||||
|
url: `https://github.com/yt-dlp/yt-dlp-nightly-builds/releases${versions['yt-dlp'] === 'latest' ? '/latest' : ''}/download${versions['yt-dlp'] !== 'latest' ? '/'+versions['yt-dlp'] : ''}/yt-dlp.exe`,
|
||||||
|
src: path.join(downloadDir, 'yt-dlp-x86_64-pc-windows-msvc.exe'),
|
||||||
|
dest: [
|
||||||
|
path.join(binDir, 'yt-dlp-x86_64-pc-windows-msvc.exe')
|
||||||
|
],
|
||||||
|
archive: null,
|
||||||
|
cleanup: [
|
||||||
|
path.join(downloadDir, 'yt-dlp-x86_64-pc-windows-msvc.exe')
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'yt-dlp-x86_64-unknown-linux-gnu',
|
||||||
|
platform: 'linux',
|
||||||
|
url: `https://github.com/yt-dlp/yt-dlp-nightly-builds/releases${versions['yt-dlp'] === 'latest' ? '/latest' : ''}/download${versions['yt-dlp'] !== 'latest' ? '/'+versions['yt-dlp'] : ''}/yt-dlp_linux`,
|
||||||
|
src: path.join(downloadDir, 'yt-dlp-x86_64-unknown-linux-gnu'),
|
||||||
|
dest: [
|
||||||
|
path.join(binDir, 'yt-dlp-x86_64-unknown-linux-gnu')
|
||||||
|
],
|
||||||
|
archive: null,
|
||||||
|
cleanup: [
|
||||||
|
path.join(downloadDir, 'yt-dlp-x86_64-unknown-linux-gnu')
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'yt-dlp-aarch64-unknown-linux-gnu',
|
||||||
|
platform: 'linux',
|
||||||
|
url: `https://github.com/yt-dlp/yt-dlp-nightly-builds/releases${versions['yt-dlp'] === 'latest' ? '/latest' : ''}/download${versions['yt-dlp'] !== 'latest' ? '/'+versions['yt-dlp'] : ''}/yt-dlp_linux_aarch64`,
|
||||||
|
src: path.join(downloadDir, 'yt-dlp-aarch64-unknown-linux-gnu'),
|
||||||
|
dest: [
|
||||||
|
path.join(binDir, 'yt-dlp-aarch64-unknown-linux-gnu')
|
||||||
|
],
|
||||||
|
archive: null,
|
||||||
|
cleanup: [
|
||||||
|
path.join(downloadDir, 'yt-dlp-aarch64-unknown-linux-gnu')
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'yt-dlp-universal-apple-darwin',
|
||||||
|
platform: 'darwin',
|
||||||
|
url: `https://github.com/yt-dlp/yt-dlp-nightly-builds/releases${versions['yt-dlp'] === 'latest' ? '/latest' : ''}/download${versions['yt-dlp'] !== 'latest' ? '/'+versions['yt-dlp'] : ''}/yt-dlp_macos`,
|
||||||
|
src: path.join(downloadDir, 'yt-dlp-universal-apple-darwin'),
|
||||||
|
dest: [
|
||||||
|
path.join(binDir, 'yt-dlp-x86_64-apple-darwin'),
|
||||||
|
path.join(binDir, 'yt-dlp-aarch64-apple-darwin')
|
||||||
|
],
|
||||||
|
archive: null,
|
||||||
|
cleanup: [
|
||||||
|
path.join(downloadDir, 'yt-dlp-universal-apple-darwin')
|
||||||
|
]
|
||||||
|
},
|
||||||
|
],
|
||||||
|
'ffmpeg-ffprobe': [
|
||||||
|
{
|
||||||
|
name: 'ffmpeg-ffprobe-x86_64-pc-windows-msvc',
|
||||||
|
platform: 'win32',
|
||||||
|
url: `https://github.com/yt-dlp/FFmpeg-Builds/releases${versions['ffmpeg-ffprobe'] === 'latest' ? '/latest' : ''}/download${versions['ffmpeg-ffprobe'] !== 'latest' ? '/'+versions['ffmpeg-ffprobe'] : ''}/ffmpeg-master-latest-win64-gpl.zip`,
|
||||||
|
src: path.join(downloadDir, 'ffmpeg-master-latest-win64-gpl.zip'),
|
||||||
|
dest: null,
|
||||||
|
archive: {
|
||||||
|
type: 'zip',
|
||||||
|
binSrc: [
|
||||||
|
path.join(downloadDir, 'ffmpeg-master-latest-win64-gpl', 'bin', 'ffmpeg.exe'),
|
||||||
|
path.join(downloadDir, 'ffmpeg-master-latest-win64-gpl', 'bin', 'ffprobe.exe')
|
||||||
|
],
|
||||||
|
binDest: [
|
||||||
|
path.join(binDir, 'ffmpeg-x86_64-pc-windows-msvc.exe'),
|
||||||
|
path.join(binDir, 'ffprobe-x86_64-pc-windows-msvc.exe')
|
||||||
|
]
|
||||||
|
},
|
||||||
|
cleanup: [
|
||||||
|
path.join(downloadDir, 'ffmpeg-master-latest-win64-gpl.zip'),
|
||||||
|
path.join(downloadDir, 'ffmpeg-master-latest-win64-gpl')
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'ffmpeg-ffprobe-x86_64-unknown-linux-gnu',
|
||||||
|
platform: 'linux',
|
||||||
|
url: `https://github.com/yt-dlp/FFmpeg-Builds/releases${versions['ffmpeg-ffprobe'] === 'latest' ? '/latest' : ''}/download${versions['ffmpeg-ffprobe'] !== 'latest' ? '/'+versions['ffmpeg-ffprobe'] : ''}/ffmpeg-master-latest-linux64-gpl.tar.xz`,
|
||||||
|
src: path.join(downloadDir, 'ffmpeg-master-latest-linux64-gpl.tar.xz'),
|
||||||
|
dest: null,
|
||||||
|
archive: {
|
||||||
|
type: 'tar.xz',
|
||||||
|
binSrc: [
|
||||||
|
path.join(downloadDir, 'ffmpeg-master-latest-linux64-gpl', 'bin', 'ffmpeg'),
|
||||||
|
path.join(downloadDir, 'ffmpeg-master-latest-linux64-gpl', 'bin', 'ffprobe')
|
||||||
|
],
|
||||||
|
binDest: [
|
||||||
|
path.join(binDir, 'ffmpeg-x86_64-unknown-linux-gnu'),
|
||||||
|
path.join(binDir, 'ffprobe-x86_64-unknown-linux-gnu')
|
||||||
|
]
|
||||||
|
},
|
||||||
|
cleanup: [
|
||||||
|
path.join(downloadDir, 'ffmpeg-master-latest-linux64-gpl.tar.xz'),
|
||||||
|
path.join(downloadDir, 'ffmpeg-master-latest-linux64-gpl')
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'ffmpeg-ffprobe-aarch64-unknown-linux-gnu',
|
||||||
|
platform: 'linux',
|
||||||
|
url: `https://github.com/yt-dlp/FFmpeg-Builds/releases${versions['ffmpeg-ffprobe'] === 'latest' ? '/latest' : ''}/download${versions['ffmpeg-ffprobe'] !== 'latest' ? '/'+versions['ffmpeg-ffprobe'] : ''}/ffmpeg-master-latest-linuxarm64-gpl.tar.xz`,
|
||||||
|
src: path.join(downloadDir, 'ffmpeg-master-latest-linuxarm64-gpl.tar.xz'),
|
||||||
|
dest: null,
|
||||||
|
archive: {
|
||||||
|
type: 'tar.xz',
|
||||||
|
binSrc: [
|
||||||
|
path.join(downloadDir, 'ffmpeg-master-latest-linuxarm64-gpl', 'bin', 'ffmpeg'),
|
||||||
|
path.join(downloadDir, 'ffmpeg-master-latest-linuxarm64-gpl', 'bin', 'ffprobe')
|
||||||
|
],
|
||||||
|
binDest: [
|
||||||
|
path.join(binDir, 'ffmpeg-aarch64-unknown-linux-gnu'),
|
||||||
|
path.join(binDir, 'ffprobe-aarch64-unknown-linux-gnu')
|
||||||
|
]
|
||||||
|
},
|
||||||
|
cleanup: [
|
||||||
|
path.join(downloadDir, 'ffmpeg-master-latest-linuxarm64-gpl.tar.xz'),
|
||||||
|
path.join(downloadDir, 'ffmpeg-master-latest-linuxarm64-gpl')
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'ffmpeg-universal-apple-darwin',
|
||||||
|
platform: 'darwin',
|
||||||
|
url: `https://evermeet.cx/ffmpeg/get/zip`,
|
||||||
|
src: path.join(downloadDir, 'ffmpeg-universal-apple-darwin.zip'),
|
||||||
|
dest: null,
|
||||||
|
archive: {
|
||||||
|
type: 'zip',
|
||||||
|
binSrc: [
|
||||||
|
path.join(downloadDir, 'ffmpeg'),
|
||||||
|
path.join(downloadDir, 'ffmpeg')
|
||||||
|
],
|
||||||
|
binDest: [
|
||||||
|
path.join(binDir, 'ffmpeg-x86_64-apple-darwin'),
|
||||||
|
path.join(binDir, 'ffmpeg-aarch64-apple-darwin')
|
||||||
|
]
|
||||||
|
},
|
||||||
|
cleanup: [
|
||||||
|
path.join(downloadDir, 'ffmpeg-universal-apple-darwin.zip'),
|
||||||
|
path.join(downloadDir, 'ffmpeg')
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'ffprobe-universal-apple-darwin',
|
||||||
|
platform: 'darwin',
|
||||||
|
url: `https://evermeet.cx/ffmpeg/getrelease/ffprobe/zip`,
|
||||||
|
src: path.join(downloadDir, 'ffprobe-universal-apple-darwin.zip'),
|
||||||
|
dest: null,
|
||||||
|
archive: {
|
||||||
|
type: 'zip',
|
||||||
|
binSrc: [
|
||||||
|
path.join(downloadDir, 'ffprobe'),
|
||||||
|
path.join(downloadDir, 'ffprobe')
|
||||||
|
],
|
||||||
|
binDest: [
|
||||||
|
path.join(binDir, 'ffprobe-x86_64-apple-darwin'),
|
||||||
|
path.join(binDir, 'ffprobe-aarch64-apple-darwin')
|
||||||
|
]
|
||||||
|
},
|
||||||
|
cleanup: [
|
||||||
|
path.join(downloadDir, 'ffprobe-universal-apple-darwin.zip'),
|
||||||
|
path.join(downloadDir, 'ffprobe')
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
'deno': [
|
||||||
|
{
|
||||||
|
name: 'deno-x86_64-pc-windows-msvc',
|
||||||
|
platform: 'win32',
|
||||||
|
url: `https://github.com/denoland/deno/releases${versions['deno'] === 'latest' ? '/latest' : ''}/download${versions['deno'] !== 'latest' ? '/'+versions['deno'] : ''}/deno-x86_64-pc-windows-msvc.zip`,
|
||||||
|
src: path.join(downloadDir, 'deno-x86_64-pc-windows-msvc.zip'),
|
||||||
|
dest: null,
|
||||||
|
archive: {
|
||||||
|
type: 'zip',
|
||||||
|
binSrc: [
|
||||||
|
path.join(downloadDir, 'deno.exe')
|
||||||
|
],
|
||||||
|
binDest: [
|
||||||
|
path.join(binDir, 'deno-x86_64-pc-windows-msvc.exe')
|
||||||
|
]
|
||||||
|
},
|
||||||
|
cleanup: [
|
||||||
|
path.join(downloadDir, 'deno-x86_64-pc-windows-msvc.zip'),
|
||||||
|
path.join(downloadDir, 'deno.exe')
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'deno-x86_64-unknown-linux-gnu',
|
||||||
|
platform: 'linux',
|
||||||
|
url: `https://github.com/denoland/deno/releases${versions['deno'] === 'latest' ? '/latest' : ''}/download${versions['deno'] !== 'latest' ? '/'+versions['deno'] : ''}/deno-x86_64-unknown-linux-gnu.zip`,
|
||||||
|
src: path.join(downloadDir, 'deno-x86_64-unknown-linux-gnu.zip'),
|
||||||
|
dest: null,
|
||||||
|
archive: {
|
||||||
|
type: 'zip',
|
||||||
|
binSrc: [
|
||||||
|
path.join(downloadDir, 'deno')
|
||||||
|
],
|
||||||
|
binDest: [
|
||||||
|
path.join(binDir, 'deno-x86_64-unknown-linux-gnu')
|
||||||
|
]
|
||||||
|
},
|
||||||
|
cleanup: [
|
||||||
|
path.join(downloadDir, 'deno-x86_64-unknown-linux-gnu.zip'),
|
||||||
|
path.join(downloadDir, 'deno')
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'deno-aarch64-unknown-linux-gnu',
|
||||||
|
platform: 'linux',
|
||||||
|
url: `https://github.com/denoland/deno/releases${versions['deno'] === 'latest' ? '/latest' : ''}/download${versions['deno'] !== 'latest' ? '/'+versions['deno'] : ''}/deno-aarch64-unknown-linux-gnu.zip`,
|
||||||
|
src: path.join(downloadDir, 'deno-aarch64-unknown-linux-gnu.zip'),
|
||||||
|
dest: null,
|
||||||
|
archive: {
|
||||||
|
type: 'zip',
|
||||||
|
binSrc: [
|
||||||
|
path.join(downloadDir, 'deno')
|
||||||
|
],
|
||||||
|
binDest: [
|
||||||
|
path.join(binDir, 'deno-aarch64-unknown-linux-gnu')
|
||||||
|
]
|
||||||
|
},
|
||||||
|
cleanup: [
|
||||||
|
path.join(downloadDir, 'deno-aarch64-unknown-linux-gnu.zip'),
|
||||||
|
path.join(downloadDir, 'deno')
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'deno-x86_64-apple-darwin',
|
||||||
|
platform: 'darwin',
|
||||||
|
url: `https://github.com/denoland/deno/releases${versions['deno'] === 'latest' ? '/latest' : ''}/download${versions['deno'] !== 'latest' ? '/'+versions['deno'] : ''}/deno-x86_64-apple-darwin.zip`,
|
||||||
|
src: path.join(downloadDir, 'deno-x86_64-apple-darwin.zip'),
|
||||||
|
dest: null,
|
||||||
|
archive: {
|
||||||
|
type: 'zip',
|
||||||
|
binSrc: [
|
||||||
|
path.join(downloadDir, 'deno')
|
||||||
|
],
|
||||||
|
binDest: [
|
||||||
|
path.join(binDir, 'deno-x86_64-apple-darwin')
|
||||||
|
]
|
||||||
|
},
|
||||||
|
cleanup: [
|
||||||
|
path.join(downloadDir, 'deno-x86_64-apple-darwin.zip'),
|
||||||
|
path.join(downloadDir, 'deno')
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'deno-aarch64-apple-darwin',
|
||||||
|
platform: 'darwin',
|
||||||
|
url: `https://github.com/denoland/deno/releases${versions['deno'] === 'latest' ? '/latest' : ''}/download${versions['deno'] !== 'latest' ? '/'+versions['deno'] : ''}/deno-aarch64-apple-darwin.zip`,
|
||||||
|
src: path.join(downloadDir, 'deno-aarch64-apple-darwin.zip'),
|
||||||
|
dest: null,
|
||||||
|
archive: {
|
||||||
|
type: 'zip',
|
||||||
|
binSrc: [
|
||||||
|
path.join(downloadDir, 'deno')
|
||||||
|
],
|
||||||
|
binDest: [
|
||||||
|
path.join(binDir, 'deno-aarch64-apple-darwin')
|
||||||
|
]
|
||||||
|
},
|
||||||
|
cleanup: [
|
||||||
|
path.join(downloadDir, 'deno-aarch64-apple-darwin.zip'),
|
||||||
|
path.join(downloadDir, 'deno')
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
'aria2c': [
|
||||||
|
{
|
||||||
|
name: 'aria2c-x86_64-pc-windows-msvc',
|
||||||
|
platform: 'win32',
|
||||||
|
url: `https://github.com/aria2/aria2/releases/download/release-${versions['aria2c']}/aria2-${versions['aria2c']}-win-64bit-build1.zip`,
|
||||||
|
src: path.join(downloadDir, `aria2-${versions['aria2c']}-win-64bit-build1.zip`),
|
||||||
|
dest: null,
|
||||||
|
archive: {
|
||||||
|
type: 'zip',
|
||||||
|
binSrc: [
|
||||||
|
path.join(downloadDir, `aria2-${versions['aria2c']}-win-64bit-build1`, 'aria2c.exe')
|
||||||
|
],
|
||||||
|
binDest: [
|
||||||
|
path.join(binDir, 'aria2c-x86_64-pc-windows-msvc.exe')
|
||||||
|
]
|
||||||
|
},
|
||||||
|
cleanup: [
|
||||||
|
path.join(downloadDir, `aria2-${versions['aria2c']}-win-64bit-build1.zip`),
|
||||||
|
path.join(downloadDir, `aria2-${versions['aria2c']}-win-64bit-build1`)
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'aria2c-x86_64-unknown-linux-gnu',
|
||||||
|
platform: 'linux',
|
||||||
|
url: `https://github.com/asdo92/aria2-static-builds/releases/download/v${versions['aria2c']}/aria2-${versions['aria2c']}-linux-gnu-64bit-build1.tar.bz2`,
|
||||||
|
src: path.join(downloadDir, `aria2-${versions['aria2c']}-linux-gnu-64bit-build1.tar.bz2`),
|
||||||
|
dest: null,
|
||||||
|
archive: {
|
||||||
|
type: 'tar.bz2',
|
||||||
|
binSrc: [
|
||||||
|
path.join(downloadDir, `aria2-${versions['aria2c']}-linux-gnu-64bit-build1`, 'aria2c')
|
||||||
|
],
|
||||||
|
binDest: [
|
||||||
|
path.join(binDir, 'aria2c-x86_64-unknown-linux-gnu')
|
||||||
|
]
|
||||||
|
},
|
||||||
|
cleanup: [
|
||||||
|
path.join(downloadDir, `aria2-${versions['aria2c']}-linux-gnu-64bit-build1.tar.bz2`),
|
||||||
|
path.join(downloadDir, `aria2-${versions['aria2c']}-linux-gnu-64bit-build1`)
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'aria2c-aarch64-unknown-linux-gnu',
|
||||||
|
platform: 'linux',
|
||||||
|
url: `https://github.com/aria2/aria2/releases/download/release-${versions['aria2c']}/aria2-${versions['aria2c']}-aarch64-linux-android-build1.zip`,
|
||||||
|
src: path.join(downloadDir, `aria2-${versions['aria2c']}-aarch64-linux-android-build1.zip`),
|
||||||
|
dest: null,
|
||||||
|
archive: {
|
||||||
|
type: 'zip',
|
||||||
|
binSrc: [
|
||||||
|
path.join(downloadDir, `aria2-${versions['aria2c']}-aarch64-linux-android-build1`, 'aria2c')
|
||||||
|
],
|
||||||
|
binDest: [
|
||||||
|
path.join(binDir, 'aria2c-aarch64-unknown-linux-gnu')
|
||||||
|
]
|
||||||
|
},
|
||||||
|
cleanup: [
|
||||||
|
path.join(downloadDir, `aria2-${versions['aria2c']}-aarch64-linux-android-build1.zip`),
|
||||||
|
path.join(downloadDir, `aria2-${versions['aria2c']}-aarch64-linux-android-build1`)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
function downloadAndProcess(bin) {
|
||||||
|
console.log(`=> Processing: ${bin.name}`);
|
||||||
|
console.log(`Downloading: ${bin.url}`);
|
||||||
|
if (platform === 'win32') {
|
||||||
|
execSync(`powershell -Command "Invoke-WebRequest -Uri '${bin.url}' -OutFile '${bin.src}'"`, { stdio: 'inherit' });
|
||||||
|
} else {
|
||||||
|
execSync(`curl -L "${bin.url}" -o "${bin.src}"`, { stdio: 'inherit' });
|
||||||
|
}
|
||||||
|
|
||||||
|
if (bin.archive) {
|
||||||
|
console.log(`Extracting: ${bin.src}`);
|
||||||
|
if (platform === 'win32' && bin.archive.type === 'zip') {
|
||||||
|
execSync(`powershell -Command "Add-Type -AssemblyName System.IO.Compression.FileSystem; [System.IO.Compression.ZipFile]::ExtractToDirectory('${bin.src}', '${downloadDir}')"`, { stdio: 'inherit' });
|
||||||
|
} else if (bin.archive.type === 'tar.bz2') {
|
||||||
|
execSync(`tar -xjf "${bin.src}" -C "${downloadDir}"`, { stdio: 'inherit' });
|
||||||
|
} else if (bin.archive.type === 'zip') {
|
||||||
|
execSync(`unzip -o "${bin.src}" -d "${downloadDir}"`, { stdio: 'inherit' });
|
||||||
|
} else {
|
||||||
|
execSync(`tar -xf "${bin.src}" -C "${downloadDir}"`, { stdio: 'inherit' });
|
||||||
|
}
|
||||||
|
|
||||||
|
bin.archive.binSrc.forEach((src, index) => {
|
||||||
|
const dest = bin.archive.binDest[index];
|
||||||
|
console.log(`Moving: "${src}" to "${dest}"`);
|
||||||
|
fs.copyFileSync(src, dest);
|
||||||
|
if (platform !== 'win32') {
|
||||||
|
fs.chmodSync(dest, 0o755);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else if (bin.dest) {
|
||||||
|
bin.dest.forEach((dest) => {
|
||||||
|
console.log(`Moving: "${bin.src}" to "${dest}"`);
|
||||||
|
fs.copyFileSync(bin.src, dest);
|
||||||
|
if (platform !== 'win32') {
|
||||||
|
fs.chmodSync(dest, 0o755);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
bin.cleanup.forEach((item) => {
|
||||||
|
if (fs.existsSync(item)) {
|
||||||
|
console.log(`Cleaning: "${item}"`);
|
||||||
|
const stats = fs.statSync(item);
|
||||||
|
if (stats.isDirectory()) {
|
||||||
|
fs.rmSync(item, { recursive: true, force: true });
|
||||||
|
} else {
|
||||||
|
fs.unlinkSync(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log(`\n`);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (targetPlatform && !['win32', 'linux', 'darwin', 'all'].includes(targetPlatform)) {
|
||||||
|
console.error(`ERROR: Invalid platform specified: '${targetPlatform}'. Use one of: win32, linux, darwin, or all`);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (targetBin && !binaries.hasOwnProperty(targetBin) && targetBin !== 'all') {
|
||||||
|
console.error(`ERROR: Invalid binary specified: '${targetBin}'. Use one of: ${Object.keys(binaries).join(', ')}, or all`);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
const effectivePlatform = targetPlatform || platform;
|
||||||
|
const effectiveBin = targetBin || 'all';
|
||||||
|
|
||||||
|
console.log(`RUNNING: ⚙️ Binary Download (platform: ${effectivePlatform} | binary: ${effectiveBin})`);
|
||||||
|
|
||||||
|
Object.keys(binaries).forEach((binKey) => {
|
||||||
|
if (effectiveBin !== 'all' && binKey !== effectiveBin) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
binaries[binKey].forEach((bin) => {
|
||||||
|
if (effectivePlatform !== 'all' && bin.platform !== effectivePlatform) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
downloadAndProcess(bin);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log('✅ Downloads Completed');
|
||||||
0
src-tauri/binaries/.gitkeep
Normal file
0
src-tauri/binaries/.gitkeep
Normal file
@@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:9397aac0de54c8c15b8166486eb80bfe27937bd6d6b6af4bb8383b155213bec1
|
|
||||||
size 6100888
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:cca868da48a85c13a56ccac4dfa8c098f7ed799786a9eaf88248221dbb785bb9
|
|
||||||
size 8089088
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:36f66dab69edcc44255d0dba90c93f5aa4a304ec60c7136d8c279dfc89c23e1d
|
|
||||||
size 9666624
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:b2243469ad3e5d874a2ccf87d3375ea6566c65b9aeae7154de7ad4dd403ef23d
|
|
||||||
size 91664944
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:f13fc741f238849e8c2d48587ae4eced59abec6864b05b618feb5dc28168baff
|
|
||||||
size 103329904
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:30c6df2176d096fafbdc0f049a68d4a4466360fd8f8daf698d3fc406b0f7a5c7
|
|
||||||
size 102795504
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:9037f4f141020246aac5f65336cda8127808d644a391df2502f76ef7ea3bdefb
|
|
||||||
size 117761496
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:d96ceee08834553afb6d6cc6bc76cc3120ce765fe309ce1813b0dd1428c0bce9
|
|
||||||
size 113570336
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:7717da6f1d21ec928aba5421f3ca83eddba63f6602e80a14901a2935982bf2f0
|
|
||||||
size 80129848
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:8f0364b1e3db45af96ca1149bc76b6593713446dff28458681302861214a2ca5
|
|
||||||
size 152316736
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:7717da6f1d21ec928aba5421f3ca83eddba63f6602e80a14901a2935982bf2f0
|
|
||||||
size 80129848
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:1df43d5ee4c7ef9379f29fdddd9f7c538f6362de478ed4883ac566ad0dd65166
|
|
||||||
size 190388224
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:3e3b84c425dd3c9f3b88712df0a3cf3ea844fb5968f15ed05eae63a0c2068fc7
|
|
||||||
size 191335144
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:90cae105568f54d029fbaacf25a4879f44b25aaa32fa2ba369696dfeac00d6c9
|
|
||||||
size 79947928
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:265c8a8a5b386970facc84e54cb3bfb72579d6729ce0d9b9a64d1ae4864c1274
|
|
||||||
size 152125760
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:90cae105568f54d029fbaacf25a4879f44b25aaa32fa2ba369696dfeac00d6c9
|
|
||||||
size 79947928
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:19208c2236b754cd359f6397ea1202521d961bba586c2434a0c99d056281aa87
|
|
||||||
size 190191104
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:f8d7c94d5f600f8acd3555ebb64ce87a410dca9a84bb4ec586ba2c76cb594fdd
|
|
||||||
size 191123432
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:4b8c840bf89c4428ada0c79bbae63e300d889c15efaf09321d42f502689bc5ed
|
|
||||||
size 35764384
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:59de22585cc971159674d797a2e094fb0c05a9238bbb8d3f7120f4867dfc699f
|
|
||||||
size 37285184
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:4b8c840bf89c4428ada0c79bbae63e300d889c15efaf09321d42f502689bc5ed
|
|
||||||
size 35764384
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:2f7446c110e4d2ccad95338871cd82d60354a85b82cfe1bc776b67b0deb8db8a
|
|
||||||
size 18344563
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:d960d82b390bf63f79863d0a7b51df638ffc5d31e93aae42ba8bcf35927d94a0
|
|
||||||
size 37600736
|
|
||||||
0
src-tauri/resources/downloads/.gitkeep
Normal file
0
src-tauri/resources/downloads/.gitkeep
Normal file
Reference in New Issue
Block a user