Skip to content

Commit

Permalink
fix tor path for built app
Browse files Browse the repository at this point in the history
  • Loading branch information
EmiM committed Jun 13, 2023
1 parent c5f56f6 commit 9d47ed9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions packages/backend/src/common/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,17 @@ export const torBinForPlatform = (basePath: string = '', binName: string = 'tor'
}

export const torDirForPlatform = (basePath?: string): string => {
let torPath
let torPath: string
if (!basePath) {
basePath = path.join(process.cwd(), '..', '..', '3rd-party')
const platformPath = process.platform === 'darwin' ? path.join(process.platform, process.arch) : process.platform
basePath = path.join(process.cwd(), '..', '..', '3rd-party')
torPath = path.join(basePath, 'tor', platformPath)
} else {
torPath = path.join(basePath, 'tor')
if (process.platform === 'darwin') {
torPath = path.join(basePath, 'tor', process.arch)
} else {
torPath = path.join(basePath, 'tor')
}
}
return torPath
}
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"copyBinariesDarwin": "cp -R ../../3rd-party/tor/$SOURCE_PATH/ ./tor/ && chmod 775 ./tor/arm64/tor ./tor/x64/tor",
"copyBinariesWin": "xcopy ..\\..\\3rd-party\\tor\\win32 .\\tor\\",
"pullLibs": "wget -N https://zbay-binaries.s3.us-east-2.amazonaws.com/$SOURCE_PATH/libssl.so -P ./ && chmod 775 ./libssl.so",
"dist": "export SOURCE_PATH=darwin && npm run copyBinariesDarwin && npm run build:prod && electron-builder --mac",
"dist": "export SOURCE_PATH=darwin TEST_MODE=true && npm run copyBinariesDarwin && npm run build:prod && electron-builder --mac",
"distUbuntu": "export SOURCE_PATH=linux TEST_MODE=true && npm run setMainEnvs && npm run copyBinaries && npm run pullLibs && npm run build:prod && electron-builder --linux",
"distwin": "export SOURCE_PATH=win32 && npm run copyBinariesWin && npm run build:prod && electron-builder --win",
"lint": "eslint --ext .jsx,.js,.ts,.tsx ./src/ --fix",
Expand Down

0 comments on commit 9d47ed9

Please sign in to comment.