From 6356371797cf882a9472f8be4aa9f8c7bbfb3d21 Mon Sep 17 00:00:00 2001 From: Daniel LaCosse <3759828+daniellacosse@users.noreply.github.com> Date: Mon, 5 Feb 2024 16:22:17 -0500 Subject: [PATCH] fix(www): don't try to build tun2socks when developing for the browser (#1833) * fix(www): don't try to build tun2socks when developing for the browser * do it in the javascript --- src/tun2socks/build.action.mjs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/tun2socks/build.action.mjs b/src/tun2socks/build.action.mjs index 86d4fb8900..c91c9889e6 100644 --- a/src/tun2socks/build.action.mjs +++ b/src/tun2socks/build.action.mjs @@ -27,8 +27,18 @@ export async function main(...parameters) { const currentPlatform = os.platform() === 'win32' ? 'windows' : os.platform(); + if (targetPlatform === 'browser') { + return; + } + if (targetPlatform === currentPlatform && ['linux', 'windows'].includes(targetPlatform)) { - return spawnStream('go', 'build', '-o', `output/build/${targetPlatform}/tun2socks`, 'github.com/Jigsaw-Code/outline-client/src/tun2socks/outline/electron'); + return spawnStream( + 'go', + 'build', + '-o', + `output/build/${targetPlatform}/tun2socks`, + 'github.com/Jigsaw-Code/outline-client/src/tun2socks/outline/electron' + ); } await spawnStream('make', ['ios', 'macos', 'maccatalyst'].includes(targetPlatform) ? 'apple' : targetPlatform);