obsidian-launcher 2.1.3 → 2.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-AUVMYPHG.js → chunk-RFPT36TQ.js} +19 -6
- package/dist/{chunk-AUVMYPHG.js.map → chunk-RFPT36TQ.js.map} +1 -1
- package/dist/{chunk-T56PL6MR.cjs → chunk-YJWPOCL6.cjs} +19 -6
- package/dist/chunk-YJWPOCL6.cjs.map +1 -0
- package/dist/cli.cjs +4 -4
- package/dist/cli.js +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-T56PL6MR.cjs.map +0 -1
|
@@ -360,12 +360,14 @@ var ChromeLocalStorage = class {
|
|
|
360
360
|
import fsAsync3 from "fs/promises";
|
|
361
361
|
import fs3 from "fs";
|
|
362
362
|
import path4 from "path";
|
|
363
|
+
import { promisify } from "util";
|
|
363
364
|
import child_process from "child_process";
|
|
364
365
|
import semver from "semver";
|
|
365
366
|
import _3 from "lodash";
|
|
366
367
|
import { pipeline } from "stream/promises";
|
|
367
368
|
import zlib from "zlib";
|
|
368
369
|
import { fileURLToPath } from "url";
|
|
370
|
+
var execFile = promisify(child_process.execFile);
|
|
369
371
|
function normalizeGitHubRepo(repo) {
|
|
370
372
|
return repo.match(/^(https?:\/\/)?(github.com\/)?(.*?)\/?$/)?.[3] ?? repo;
|
|
371
373
|
}
|
|
@@ -424,12 +426,23 @@ async function extractObsidianExe(exe, arch, dest) {
|
|
|
424
426
|
async function extractObsidianDmg(dmg, dest) {
|
|
425
427
|
dest = path4.resolve(dest);
|
|
426
428
|
await atomicCreate(dest, async (scratch) => {
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
429
|
+
if (process.platform == "darwin") {
|
|
430
|
+
const proc = await execFile("hdiutil", ["attach", "-nobrowse", "-readonly", dmg]);
|
|
431
|
+
const volume = proc.stdout.match(/\/Volumes\/.*$/m)[0];
|
|
432
|
+
const files = await fsAsync3.readdir(volume);
|
|
433
|
+
let obsidianApp = files.includes("Obsidian.app") ? "Obsidian.app" : path4.join(files[0], "Obsidian.app");
|
|
434
|
+
obsidianApp = path4.join(volume, obsidianApp);
|
|
435
|
+
try {
|
|
436
|
+
await fsAsync3.cp(obsidianApp, scratch, { recursive: true, verbatimSymlinks: true, preserveTimestamps: true });
|
|
437
|
+
} finally {
|
|
438
|
+
await execFile("hdiutil", ["detach", volume]);
|
|
439
|
+
}
|
|
440
|
+
return scratch;
|
|
431
441
|
} else {
|
|
432
|
-
|
|
442
|
+
await sevenZ(["x", "-o.", path4.relative(scratch, dmg), "*/Obsidian.app", "Obsidian.app"], { cwd: scratch });
|
|
443
|
+
const files = await fsAsync3.readdir(scratch);
|
|
444
|
+
const obsidianApp = files.includes("Obsidian.app") ? "Obsidian.app" : path4.join(files[0], "Obsidian.app");
|
|
445
|
+
return path4.join(scratch, obsidianApp);
|
|
433
446
|
}
|
|
434
447
|
});
|
|
435
448
|
}
|
|
@@ -1583,4 +1596,4 @@ export {
|
|
|
1583
1596
|
watchFiles,
|
|
1584
1597
|
ObsidianLauncher
|
|
1585
1598
|
};
|
|
1586
|
-
//# sourceMappingURL=chunk-
|
|
1599
|
+
//# sourceMappingURL=chunk-RFPT36TQ.js.map
|