Skip to content

Commit

Permalink
fix(build): fix Outline Client build in Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
jyyi1 committed Apr 1, 2024
1 parent a310b2f commit 5322b38
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
"karma-webpack": "^5.0.0",
"minimist": "^1.2.6",
"node-fetch": "^3.3.0",
"node-gyp": "^10.0.1",
"node-gyp": "^10.1.0",
"outline-i18n": "Jigsaw-Code/outline-i18n#v0.0.7",
"postcss": "^7.0.39",
"postcss-rtl": "^1.7.3",
Expand Down
6 changes: 5 additions & 1 deletion src/infrastructure/electron/app_paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,9 @@ export function getAppPath() {
}

export function pathToEmbeddedBinary(filename: string) {
return path.join(unpackedAppPath(), 'output', 'build', os.platform(), filename + (isWindows ? '.exe' : ''));
let osName = os.platform().toString(); /* should be either 'linux' or 'win32' */
if (osName === 'win32') {
osName = 'windows';
}
return path.join(unpackedAppPath(), 'output', 'build', osName, filename + (isWindows ? '.exe' : ''));
}
2 changes: 1 addition & 1 deletion src/tun2socks/build.action.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export async function main(...parameters) {
'go',
'build',
'-o',
`output/build/${targetPlatform}/tun2socks`,
`output/build/${targetPlatform}/tun2socks${targetPlatform === 'windows' ? '.exe' : ''}`,
'github.com/Jigsaw-Code/outline-client/src/tun2socks/outline/electron'
);
}
Expand Down

0 comments on commit 5322b38

Please sign in to comment.