diff --git a/makeFilesExecutable.js b/scripts/chmod.js similarity index 88% rename from makeFilesExecutable.js rename to scripts/chmod.js index 6ad4538..145724f 100644 --- a/makeFilesExecutable.js +++ b/scripts/chmod.js @@ -5,10 +5,11 @@ import { execSync } from 'child_process'; const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); +const projectRoot = path.resolve(__dirname, '..'); // Define array of binary source directories const binSrcDirs = [ - path.join(__dirname, 'src-tauri', 'binaries'), + path.join(projectRoot, 'src-tauri', 'binaries'), ]; function makeFilesExecutable() { @@ -34,7 +35,7 @@ function makeFilesExecutable() { count++; } } - + console.log(`Successfully made ${count} files executable in ${binSrc}`); totalCount += count; successDirs++; @@ -46,5 +47,5 @@ function makeFilesExecutable() { console.log(`\nSummary: Made ${totalCount} files executable across ${successDirs} directories`); } -console.log(`RUNNING: 🛠️ Build Script makeFilesExecutable.js`); -makeFilesExecutable(); \ No newline at end of file +console.log(`RUNNING: 🛠️ Build Script --> chmod.js`); +makeFilesExecutable(); diff --git a/updateYtDlpBinary.js b/scripts/update-yt-dlp.js similarity index 88% rename from updateYtDlpBinary.js rename to scripts/update-yt-dlp.js index 609798f..7a4bab6 100644 --- a/updateYtDlpBinary.js +++ b/scripts/update-yt-dlp.js @@ -5,8 +5,9 @@ import { fileURLToPath } from 'url'; const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); +const projectRoot = path.resolve(__dirname, '..'); -console.log(`RUNNING: 🛠️ Build Script updateYtDlpBinary.js`); +console.log(`RUNNING: 🛠️ Build Script --> update-yt-dlp.js`); // Get the platform triple from command line arguments const platformTriple = process.argv[2]; @@ -17,7 +18,7 @@ if (!platformTriple) { } // Define the binaries directory -const binariesDir = path.join(__dirname, 'src-tauri', 'binaries'); +const binariesDir = path.join(projectRoot, 'src-tauri', 'binaries'); // Construct the binary filename based on platform triple let binaryName = `yt-dlp-${platformTriple}`; @@ -50,7 +51,7 @@ execFile(binaryPath, ['--update-to', 'nightly'], (error, stdout, stderr) => { if (stderr) console.error(stderr); process.exit(1); } - + console.log(`Update successful for ${platformTriple}:`); console.log(stdout); -}); \ No newline at end of file +}); diff --git a/src-tauri/tauri.linux-aarch64.conf.json b/src-tauri/tauri.linux-aarch64.conf.json index 85f76b7..20fc669 100644 --- a/src-tauri/tauri.linux-aarch64.conf.json +++ b/src-tauri/tauri.linux-aarch64.conf.json @@ -1,8 +1,8 @@ { "identifier": "com.neosubhamoy.neodlp", "build": { - "beforeDevCommand": "cargo build --target=aarch64-unknown-linux-gnu --manifest-path=./src-tauri/msghost/Cargo.toml && node makeFilesExecutable.js && npm run dev", - "beforeBuildCommand": "cargo build --release --target=aarch64-unknown-linux-gnu --manifest-path=./src-tauri/msghost/Cargo.toml && node makeFilesExecutable.js && npm run build", + "beforeDevCommand": "cargo build --target=aarch64-unknown-linux-gnu --manifest-path=./src-tauri/msghost/Cargo.toml && node scripts/chmod.js && npm run dev", + "beforeBuildCommand": "cargo build --release --target=aarch64-unknown-linux-gnu --manifest-path=./src-tauri/msghost/Cargo.toml && node scripts/chmod.js && npm run build", "devUrl": "http://localhost:1420", "frontendDist": "../dist" }, diff --git a/src-tauri/tauri.linux-x86_64.conf.json b/src-tauri/tauri.linux-x86_64.conf.json index 90fc041..0268c22 100644 --- a/src-tauri/tauri.linux-x86_64.conf.json +++ b/src-tauri/tauri.linux-x86_64.conf.json @@ -1,8 +1,8 @@ { "identifier": "com.neosubhamoy.neodlp", "build": { - "beforeDevCommand": "cargo build --target=x86_64-unknown-linux-gnu --manifest-path=./src-tauri/msghost/Cargo.toml && node makeFilesExecutable.js && npm run dev", - "beforeBuildCommand": "cargo build --release --target=x86_64-unknown-linux-gnu --manifest-path=./src-tauri/msghost/Cargo.toml && node makeFilesExecutable.js && npm run build", + "beforeDevCommand": "cargo build --target=x86_64-unknown-linux-gnu --manifest-path=./src-tauri/msghost/Cargo.toml && node scripts/chmod.js && npm run dev", + "beforeBuildCommand": "cargo build --release --target=x86_64-unknown-linux-gnu --manifest-path=./src-tauri/msghost/Cargo.toml && node scripts/chmod.js && npm run build", "devUrl": "http://localhost:1420", "frontendDist": "../dist" }, diff --git a/src-tauri/tauri.macos-aarch64.conf.json b/src-tauri/tauri.macos-aarch64.conf.json index 6765cbb..7948a1d 100644 --- a/src-tauri/tauri.macos-aarch64.conf.json +++ b/src-tauri/tauri.macos-aarch64.conf.json @@ -1,8 +1,8 @@ { "identifier": "com.neosubhamoy.neodlp", "build": { - "beforeDevCommand": "cargo build --target=aarch64-apple-darwin --manifest-path=./src-tauri/msghost/Cargo.toml && node makeFilesExecutable.js && npm run dev", - "beforeBuildCommand": "cargo build --release --target=aarch64-apple-darwin --manifest-path=./src-tauri/msghost/Cargo.toml && node makeFilesExecutable.js && npm run build", + "beforeDevCommand": "cargo build --target=aarch64-apple-darwin --manifest-path=./src-tauri/msghost/Cargo.toml && node scripts/chmod.js && npm run dev", + "beforeBuildCommand": "cargo build --release --target=aarch64-apple-darwin --manifest-path=./src-tauri/msghost/Cargo.toml && node scripts/chmod.js && npm run build", "devUrl": "http://localhost:1420", "frontendDist": "../dist" }, diff --git a/src-tauri/tauri.macos-x86_64.conf.json b/src-tauri/tauri.macos-x86_64.conf.json index 2db98b7..b32dcf1 100644 --- a/src-tauri/tauri.macos-x86_64.conf.json +++ b/src-tauri/tauri.macos-x86_64.conf.json @@ -1,8 +1,8 @@ { "identifier": "com.neosubhamoy.neodlp", "build": { - "beforeDevCommand": "cargo build --target=x86_64-apple-darwin --manifest-path=./src-tauri/msghost/Cargo.toml && node makeFilesExecutable.js && npm run dev", - "beforeBuildCommand": "cargo build --release --target=x86_64-apple-darwin --manifest-path=./src-tauri/msghost/Cargo.toml && node makeFilesExecutable.js && npm run build", + "beforeDevCommand": "cargo build --target=x86_64-apple-darwin --manifest-path=./src-tauri/msghost/Cargo.toml && node scripts/chmod.js && npm run dev", + "beforeBuildCommand": "cargo build --release --target=x86_64-apple-darwin --manifest-path=./src-tauri/msghost/Cargo.toml && node scripts/chmod.js && npm run build", "devUrl": "http://localhost:1420", "frontendDist": "../dist" },