note-connector 0.2.3 → 0.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/dist/setup-dependencies.js +17 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { execFileSync } from "node:child_process";
|
|
1
|
+
import { execFileSync, spawnSync } from "node:child_process";
|
|
2
2
|
import fs from "node:fs";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { loadConfig, saveConfig } from "./config.js";
|
|
@@ -44,6 +44,21 @@ function cloneRepo(target) {
|
|
|
44
44
|
fs.mkdirSync(path.dirname(target), { recursive: true });
|
|
45
45
|
execFileSync("git", ["clone", "--depth", "1", DEFAULT_REPO, target], { stdio: "inherit" });
|
|
46
46
|
}
|
|
47
|
+
function updateRepo(repo) {
|
|
48
|
+
try {
|
|
49
|
+
const result = spawnSync("git", ["pull", "--ff-only", "origin", "main"], {
|
|
50
|
+
cwd: repo,
|
|
51
|
+
encoding: "utf8",
|
|
52
|
+
timeout: 15000,
|
|
53
|
+
});
|
|
54
|
+
if (result.status === 0 && !String(result.stdout).trim().includes("Already up to date")) {
|
|
55
|
+
console.log("note-connector を最新に更新しました");
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
// Network issues or git not available — skip silently
|
|
60
|
+
}
|
|
61
|
+
}
|
|
47
62
|
function ensureRepoPath(config) {
|
|
48
63
|
if (config.repoPath && repoHasPython(config.repoPath)) {
|
|
49
64
|
return path.resolve(config.repoPath);
|
|
@@ -90,6 +105,7 @@ export async function setupDependencies() {
|
|
|
90
105
|
const config = loadConfig();
|
|
91
106
|
ensureUv();
|
|
92
107
|
const repo = ensureRepoPath(config);
|
|
108
|
+
updateRepo(repo);
|
|
93
109
|
runUvSync(repo);
|
|
94
110
|
ensurePlaywright(repo);
|
|
95
111
|
if (!commandExists("tailscale") && config.tunnel.provider === "tailscale" && !config.tunnel.publicUrl) {
|