Skip to content

Commit 3700417

Browse files
author
Katrina Owen
committed
Refactor download to use new workspace behavior
1 parent c1fac10 commit 3700417

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

cmd/download.go

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -130,22 +130,7 @@ func runDownload(cfg config.Config, flags *pflag.FlagSet, args []string) error {
130130
}
131131

132132
metadata := payload.metadata()
133-
134-
root := usrCfg.GetString("workspace")
135-
if metadata.Team != "" {
136-
root = filepath.Join(root, "teams", metadata.Team)
137-
}
138-
if !metadata.IsRequester {
139-
root = filepath.Join(root, "users", metadata.Handle)
140-
}
141-
142-
exercise := workspace.Exercise{
143-
Root: root,
144-
Track: metadata.Track,
145-
Slug: metadata.ExerciseSlug,
146-
}
147-
148-
dir := exercise.MetadataDir()
133+
dir := metadata.Exercise(usrCfg.GetString("workspace")).MetadataDir()
149134

150135
if err := os.MkdirAll(dir, os.FileMode(0755)); err != nil {
151136
return err

0 commit comments

Comments
 (0)