openclaw-sync-assistant 0.1.0 → 0.1.1
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/index.js +9 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -148,7 +148,15 @@ module.exports = {
|
|
|
148
148
|
} else if (syncMethod === "github") {
|
|
149
149
|
githubRepo = await text({
|
|
150
150
|
message: "请输入用于同步的 GitHub 仓库地址:",
|
|
151
|
-
placeholder: "例如: https://github.com
|
|
151
|
+
placeholder: "例如: https://github.com/user/repo.git (直接回车可跳过)",
|
|
152
|
+
validate(value) {
|
|
153
|
+
if (!value || value.trim() === "") return;
|
|
154
|
+
const githubRegex =
|
|
155
|
+
/^(https:\/\/github\.com\/|git@github\.com:)[a-zA-Z0-9_-]+\/[a-zA-Z0-9_.-]+(\.git)?$/;
|
|
156
|
+
if (!githubRegex.test(value.trim())) {
|
|
157
|
+
return "请输入有效的 GitHub 仓库地址,例如: https://github.com/user/repo.git";
|
|
158
|
+
}
|
|
159
|
+
},
|
|
152
160
|
});
|
|
153
161
|
if (typeof githubRepo === "symbol") return;
|
|
154
162
|
}
|
package/package.json
CHANGED