Skip to content

Commit

Permalink
fix(www): don't try to build tun2socks when developing for the browser (
Browse files Browse the repository at this point in the history
#1833)

* fix(www): don't try to build tun2socks when developing for the browser

* do it in the javascript
  • Loading branch information
daniellacosse authored Feb 5, 2024
1 parent e11d99e commit 6356371
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/tun2socks/build.action.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 6356371

Please sign in to comment.