Skip to content

Commit a68a291

Browse files
refactor(nodes,vm): share images subcommand with sf images
Remove the duplicate image command implementations under nodes/image/ and instead instantiate the shared createImagesCommand factory from sf images. sf nodes images and sf vm images now stay in sync with sf images automatically.
1 parent e35a88c commit a68a291

6 files changed

Lines changed: 6 additions & 785 deletions

File tree

src/lib/nodes/image/index.ts

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,3 @@
1-
import { Command } from "@commander-js/extra-typings";
2-
import list from "./list.tsx";
3-
import show from "./show.tsx";
4-
import upload from "./upload.ts";
1+
import { createImagesCommand } from "../../images/index.ts";
52

6-
const image = new Command("images")
7-
.alias("os")
8-
.alias("image")
9-
.description("Manage VM images")
10-
.showHelpAfterError()
11-
.addHelpText(
12-
"after",
13-
`
14-
Examples:\n
15-
\x1b[2m# Upload an image file\x1b[0m
16-
$ sf node image upload ./my-image.img
17-
18-
\x1b[2m# List all images\x1b[0m
19-
$ sf node image list
20-
21-
\x1b[2m# Show image details and download URL\x1b[0m
22-
$ sf node image show <image-id>
23-
`,
24-
)
25-
.addCommand(list)
26-
.addCommand(upload)
27-
.addCommand(show)
28-
.action(() => {
29-
image.help();
30-
});
31-
32-
export default image;
3+
export default createImagesCommand;

src/lib/nodes/image/list.tsx

Lines changed: 0 additions & 140 deletions
This file was deleted.

src/lib/nodes/image/show.tsx

Lines changed: 0 additions & 160 deletions
This file was deleted.

0 commit comments

Comments
 (0)