mirror of
https://github.com/laurent22/joplin.git
synced 2024-11-30 08:26:59 +02:00
Chore: Desktop: Remove duplicate buildDir
-finding logic (#9811)
This commit is contained in:
parent
bc8392ad52
commit
b51e16c255
@ -1,19 +1,11 @@
|
||||
import { join, resolve, basename, dirname } from 'path';
|
||||
import { join, resolve } from 'path';
|
||||
import bridge from '../../services/bridge';
|
||||
|
||||
const pathToBundled7Zip = () => {
|
||||
// 7zip-bin is very large -- return the path to a version of 7zip
|
||||
// copied from 7zip-bin.
|
||||
const executableName = process.platform === 'win32' ? '7za.exe' : '7za';
|
||||
|
||||
let rootDir = dirname(dirname(__dirname));
|
||||
|
||||
// When bundled, __dirname points to a file within app.asar. The build/ directory
|
||||
// is outside of app.asar, and thus, we need an extra dirname(...).
|
||||
if (basename(rootDir).startsWith('app.asar')) {
|
||||
rootDir = dirname(rootDir);
|
||||
}
|
||||
|
||||
const baseDir = join(rootDir, 'build', '7zip');
|
||||
const baseDir = join(bridge().buildDir(), '7zip');
|
||||
|
||||
return { baseDir, executableName, fullPath: resolve(join(baseDir, executableName)) };
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user