Skip to content

Commit

Permalink
Change open cmd to default to current directory (#1070)
Browse files Browse the repository at this point in the history
fixes #1069

Co-authored-by: Erik Schierboom <[email protected]>
  • Loading branch information
halfdan and ErikSchierboom authored May 2, 2024
1 parent 33ce248 commit 13d8905
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cmd/open.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@ var openCmd = &cobra.Command{
Pass the path to the directory that contains the solution you want to see on the website.
`,
Args: cobra.ExactArgs(1),
Args: cobra.MaximumNArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
metadata, err := workspace.NewExerciseMetadata(args[0])
path := "."
if len(args) == 1 {
path = args[0]
}
metadata, err := workspace.NewExerciseMetadata(path)
if err != nil {
return err
}
Expand Down

0 comments on commit 13d8905

Please sign in to comment.