Skip to content

Commit 8086bf6

Browse files
committed
Merge pull request #302 from alebaffa/submit-should-warn-users-that-try-to-check-in-a-directory
add check if the submitted filename is a directory
2 parents efa5490 + c31cddb commit 8086bf6

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

cmd/submit.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"github.com/codegangsta/cli"
1010
"github.com/exercism/cli/api"
1111
"github.com/exercism/cli/config"
12+
"github.com/exercism/cli/paths"
1213
)
1314

1415
// Submit posts an iteration to the API.
@@ -60,6 +61,10 @@ func Submit(ctx *cli.Context) {
6061
log.Fatal("You cannot submit the README as a solution.")
6162
}
6263

64+
if paths.IsDir(filename) {
65+
log.Fatal("Please specify each file that should be submitted, e.g. `exercism submit file1 file2 file3`.")
66+
}
67+
6368
file, err := filepath.Abs(filename)
6469
if err != nil {
6570
log.Fatal(err)

0 commit comments

Comments
 (0)