Skip to content

Commit 2c4ab6c

Browse files
authored
Support pulling to specific folders (#2397)
1 parent 82de546 commit 2c4ab6c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pkg/cli/pull.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121

2222
func newPullCommand() *cobra.Command {
2323
cmd := &cobra.Command{
24-
Use: "pull [IMAGE]",
24+
Use: "pull [IMAGE] [FOLDER]",
2525

2626
Short: "Pull the contents of a model into your local directory.",
2727
Example: `cog pull r8.im/your-username/hotdog-detector`,
@@ -141,7 +141,11 @@ func pull(cmd *cobra.Command, args []string) error {
141141
image := args[0]
142142

143143
// Create the working folder
144-
projectDir = imageToDir(image, projectDir)
144+
if len(args) == 1 {
145+
projectDir = imageToDir(image, projectDir)
146+
} else {
147+
projectDir = filepath.Join(projectDir, args[1])
148+
}
145149
err = os.MkdirAll(projectDir, 0o755)
146150
if err != nil {
147151
logClient.EndPull(ctx, err, logCtx)

0 commit comments

Comments
 (0)