fix: restore formatting and README link emphasis

This commit is contained in:
xixu-me committed 2026-03-27 01:30:59 +08:00
1 parent 0d4986ecea
commit 41dcda8cb5
9 files changed
+55 -29

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
# Skills Vault
***[汉语](./README.zh.md)***
**_[汉语](./README.zh.md)_**
The CLI for backing up and restoring [Agent Skills](https://agentskills.io).
+1 -1
View File
@@ -1,6 +1,6 @@
# Skills Vault
***[English](./README.md)***
**_[English](./README.md)_**
用于备份和恢复 [Agent Skills](https://agentskills.io) 的 CLI。
+22 -12
View File
@@ -280,7 +280,11 @@ async function runRestoreFromManifest(
return {
exitCode: 0,
stdout: streamOutput ? (streamedOutput ? "\n" : "") : page(lines.join("\n")),
stdout: streamOutput
? streamedOutput
? "\n"
: ""
: page(lines.join("\n")),
stderr: "",
payload: {
manifestPath,
@@ -413,7 +417,11 @@ async function runRestoreFromManifest(
) {
return {
exitCode: 1,
stdout: streamOutput ? (streamedOutput ? "\n" : "") : page(lines.join("\n")),
stdout: streamOutput
? streamedOutput
? "\n"
: ""
: page(lines.join("\n")),
stderr: page(
formatGlobalSkillStateMismatch(globalSkillStateDiff)
.map((line) => errorMessage(line))
@@ -429,7 +437,11 @@ async function runRestoreFromManifest(
);
return {
exitCode: 0,
stdout: streamOutput ? (streamedOutput ? "\n" : "") : page(lines.join("\n")),
stdout: streamOutput
? streamedOutput
? "\n"
: ""
: page(lines.join("\n")),
stderr: "",
payload: {
manifestPath,
@@ -500,8 +512,7 @@ async function runRestoreFromManifest(
const message = error instanceof Error ? error.message : String(error);
return {
exitCode: 1,
stdout:
streamOutput
stdout: streamOutput
? streamedOutput
? "\n"
: ""
@@ -528,12 +539,13 @@ async function runRestoreFromManifest(
),
);
errors.push(
errorMessage(`Completed restore with ${failures.length} source failure(s).`),
errorMessage(
`Completed restore with ${failures.length} source failure(s).`,
),
);
return {
exitCode: 0,
stdout:
streamOutput
stdout: streamOutput
? streamedOutput
? "\n"
: ""
@@ -563,8 +575,7 @@ async function runRestoreFromManifest(
) {
return {
exitCode: 1,
stdout:
streamOutput
stdout: streamOutput
? streamedOutput
? "\n"
: ""
@@ -591,8 +602,7 @@ async function runRestoreFromManifest(
);
return {
exitCode: 0,
stdout:
streamOutput
stdout: streamOutput
? streamedOutput
? "\n"
: ""
+4 -2
View File
@@ -86,7 +86,8 @@ export function commandErrorPage(
usage: string,
example: string,
): string {
return page([
return page(
[
`${errorBadge("ERROR")} ${red(message)}`,
"",
dim(" Usage:"),
@@ -94,7 +95,8 @@ export function commandErrorPage(
"",
dim(" Example:"),
` ${example}`,
].join("\n"));
].join("\n"),
);
}
export function infoLine(text: string): string {
+4 -2
View File
@@ -192,9 +192,11 @@ test("shows help before project-scope validation", async () => {
expect(plainStdout).toContain(
"\n\nExplore the open-source repo at https://github.com/xixu-me/skills-vault",
);
expect(plainStdout.endsWith(
expect(
plainStdout.endsWith(
"Explore the open-source repo at https://github.com/xixu-me/skills-vault\n\n",
)).toBe(true);
),
).toBe(true);
expect(result.stdout).toContain(
"Explore the open-source repo at https://github.com/xixu-me/skills-vault",
);
+11 -5
View File
@@ -82,9 +82,11 @@ test("prints top-level help", async () => {
expect(plainStdout).toContain(
"\n\nExplore the open-source repo at https://github.com/xixu-me/skills-vault",
);
expect(plainStdout.endsWith(
expect(
plainStdout.endsWith(
"Explore the open-source repo at https://github.com/xixu-me/skills-vault\n\n",
)).toBe(true);
),
).toBe(true);
expect(result.stdout).toContain(
"Explore the open-source repo at https://github.com/xixu-me/skills-vault",
);
@@ -176,7 +178,9 @@ test("uses process argv when invoked like the CLI", async () => {
expect(plainStdout).toContain(
"The CLI for backing up and restoring Agent Skills",
);
expect(plainStdout).toContain("Explore the open-source repo at https://github.com/xixu-me/skills-vault");
expect(plainStdout).toContain(
"Explore the open-source repo at https://github.com/xixu-me/skills-vault",
);
expect(plainStdout).not.toContain("try:");
expect(stdoutText).toContain("\x1b[38;5;102m");
expect(stdoutText).toContain("\x1b[38;5;145m");
@@ -205,9 +209,11 @@ test("shows a landing page when no command is provided", async () => {
expect(plainStdout).toContain(
"\n\nExplore the open-source repo at https://github.com/xixu-me/skills-vault",
);
expect(plainStdout.endsWith(
expect(
plainStdout.endsWith(
"Explore the open-source repo at https://github.com/xixu-me/skills-vault\n\n",
)).toBe(true);
),
).toBe(true);
expect(result.stdout).toContain("\x1b[38;5;102m");
expect(result.stdout).toContain("\x1b[38;5;145m");
expect(result.stdout).not.toContain("\x1b[36m");
+4 -2
View File
@@ -17,9 +17,11 @@ test("shows completion help text", async () => {
expect(plainStdout).toContain(
"\n\nExplore the open-source repo at https://github.com/xixu-me/skills-vault",
);
expect(plainStdout.endsWith(
expect(
plainStdout.endsWith(
"Explore the open-source repo at https://github.com/xixu-me/skills-vault\n\n",
)).toBe(true);
),
).toBe(true);
expect(result.stdout).toContain(
"Explore the open-source repo at https://github.com/xixu-me/skills-vault",
);
+4 -2
View File
@@ -18,9 +18,11 @@ test("shows doctor help text", async () => {
expect(plainStdout).toContain(
"\n\nExplore the open-source repo at https://github.com/xixu-me/skills-vault",
);
expect(plainStdout.endsWith(
expect(
plainStdout.endsWith(
"Explore the open-source repo at https://github.com/xixu-me/skills-vault\n\n",
)).toBe(true);
),
).toBe(true);
expect(result.stdout).toContain(
"Explore the open-source repo at https://github.com/xixu-me/skills-vault",
);
+4 -2
View File
@@ -35,9 +35,11 @@ test("shows restore help text", async () => {
expect(plainStdout).toContain(
"\n\nExplore the open-source repo at https://github.com/xixu-me/skills-vault",
);
expect(plainStdout.endsWith(
expect(
plainStdout.endsWith(
"Explore the open-source repo at https://github.com/xixu-me/skills-vault\n\n",
)).toBe(true);
),
).toBe(true);
expect(result.stdout).toContain(
`Global restore verifies ${defaultGlobalSkillsPath} against ${defaultGlobalLockFilePath}`,
);