@quark-client/quark 1.3.38 → 1.3.40
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/bin/quark.js +18 -2
- package/package.json +6 -6
package/bin/quark.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const os = require('os');
|
|
4
4
|
const path = require('path');
|
|
5
|
+
const fs = require('fs');
|
|
5
6
|
const { execSync } = require('child_process');
|
|
6
7
|
|
|
7
8
|
const platform = os.platform();
|
|
@@ -30,8 +31,23 @@ if (!pkgName) {
|
|
|
30
31
|
|
|
31
32
|
let binPath;
|
|
32
33
|
try {
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
// Try require.resolve first (for local node_modules)
|
|
35
|
+
let found = false;
|
|
36
|
+
try {
|
|
37
|
+
const pkgPath = require.resolve(pkgName);
|
|
38
|
+
binPath = path.join(path.dirname(pkgPath), '..', 'bin', platform === 'win32' ? 'quark.exe' : 'quark');
|
|
39
|
+
found = true;
|
|
40
|
+
} catch {
|
|
41
|
+
// Fall back to looking in npm's global node_modules
|
|
42
|
+
const globalNodeModulesParent = path.resolve(__dirname, '../..', '..');
|
|
43
|
+
const pkgDir = path.join(globalNodeModulesParent, pkgName);
|
|
44
|
+
const pkgJsonPath = path.join(pkgDir, 'package.json');
|
|
45
|
+
if (fs.existsSync(pkgJsonPath)) {
|
|
46
|
+
binPath = path.join(pkgDir, 'bin', platform === 'win32' ? 'quark.exe' : 'quark');
|
|
47
|
+
found = true;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
if (!found) throw new Error('package not found');
|
|
35
51
|
} catch (err) {
|
|
36
52
|
console.error(`quark: platform package not found (${pkgName})`);
|
|
37
53
|
console.error('This may happen if npm installed the main package without the matching platform package.');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quark-client/quark",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.40",
|
|
4
4
|
"description": "A local-first, keyboard-driven HTTP client",
|
|
5
5
|
"homepage": "https://github.com/crazy-vedic/Quark",
|
|
6
6
|
"repository": {
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
"node": ">=16.0.0"
|
|
22
22
|
},
|
|
23
23
|
"optionalDependencies": {
|
|
24
|
-
"@quark-client/quark-linux-x64": "1.3.
|
|
25
|
-
"@quark-client/quark-linux-arm64": "1.3.
|
|
26
|
-
"@quark-client/quark-darwin-x64": "1.3.
|
|
27
|
-
"@quark-client/quark-darwin-arm64": "1.3.
|
|
28
|
-
"@quark-client/quark-win32-x64": "1.3.
|
|
24
|
+
"@quark-client/quark-linux-x64": "1.3.40",
|
|
25
|
+
"@quark-client/quark-linux-arm64": "1.3.40",
|
|
26
|
+
"@quark-client/quark-darwin-x64": "1.3.40",
|
|
27
|
+
"@quark-client/quark-darwin-arm64": "1.3.40",
|
|
28
|
+
"@quark-client/quark-win32-x64": "1.3.40"
|
|
29
29
|
}
|
|
30
30
|
}
|