coc-vscode-loader 1.2.3 → 1.2.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/converter/package.json +1 -1
- package/lib/index.js +14 -4
- package/package.json +1 -1
package/converter/package.json
CHANGED
package/lib/index.js
CHANGED
|
@@ -39,7 +39,7 @@ var require_package = __commonJS({
|
|
|
39
39
|
"package.json"(exports2, module2) {
|
|
40
40
|
module2.exports = {
|
|
41
41
|
name: "coc-vscode-loader",
|
|
42
|
-
version: "1.2.
|
|
42
|
+
version: "1.2.4",
|
|
43
43
|
description: "Run VS Code extensions seamlessly in coc.nvim",
|
|
44
44
|
main: "lib/index.js",
|
|
45
45
|
keywords: [
|
|
@@ -543,13 +543,24 @@ async function convertSource(inputDir, name, info, onProgress) {
|
|
|
543
543
|
} else {
|
|
544
544
|
const globalPresetsCache = path3.join(os3.homedir(), ".config", "coc", "converter-cache", "presets.json");
|
|
545
545
|
if (!fs3.existsSync(globalPresetsCache)) {
|
|
546
|
+
const presetsUrl = "https://raw.githubusercontent.com/coc-plugin/coc-vscode-registry/main/presets.json";
|
|
546
547
|
try {
|
|
547
|
-
const res = await fetch(
|
|
548
|
+
const res = await fetch(presetsUrl);
|
|
548
549
|
if (res.ok) {
|
|
549
550
|
fs3.mkdirSync(path3.dirname(globalPresetsCache), { recursive: true });
|
|
550
551
|
fs3.writeFileSync(globalPresetsCache, await res.text());
|
|
551
552
|
}
|
|
552
553
|
} catch {
|
|
554
|
+
try {
|
|
555
|
+
const out = await new Promise((resolve2, reject) => {
|
|
556
|
+
(0, import_child_process2.execFile)("curl", ["-sL", presetsUrl], { encoding: "utf-8", maxBuffer: 1024 * 1024 }, (err, stdout) => err ? reject(err) : resolve2(stdout));
|
|
557
|
+
});
|
|
558
|
+
if (out) {
|
|
559
|
+
fs3.mkdirSync(path3.dirname(globalPresetsCache), { recursive: true });
|
|
560
|
+
fs3.writeFileSync(globalPresetsCache, out);
|
|
561
|
+
}
|
|
562
|
+
} catch {
|
|
563
|
+
}
|
|
553
564
|
}
|
|
554
565
|
}
|
|
555
566
|
if (fs3.existsSync(globalPresetsCache)) {
|
|
@@ -653,9 +664,8 @@ async function buildPackage(name, inputDir, info, onProgress) {
|
|
|
653
664
|
if (!tagRes.ok) throw new Error(`HTTP ${tagRes.status}`);
|
|
654
665
|
tagData = await tagRes.json();
|
|
655
666
|
} catch {
|
|
656
|
-
const { execFile: execFile2 } = require("child_process");
|
|
657
667
|
const out = await new Promise((resolve2, reject) => {
|
|
658
|
-
|
|
668
|
+
(0, import_child_process2.execFile)("curl", ["-sL", `https://api.github.com/repos/${sb.repo}/releases/latest`], { encoding: "utf-8", maxBuffer: 1024 * 1024 }, (err, stdout) => err ? reject(err) : resolve2(stdout));
|
|
659
669
|
});
|
|
660
670
|
tagData = JSON.parse(out);
|
|
661
671
|
}
|