Does your $HOME
or $(pwd)
contain spaces? That might explain why the cli thinks it’s a directory.
Can you post the result of running:
stat "$HOME/hello_world.go"
This could help us debug if there’s something that can be changed in the CLI. I quickly checked the CLI code, and it’s indeed throwing that error when the path is a directory, so the code seems correct.
I can’t reproduce your error. I can pass a path to a file to the cli directly, and when I pass a directory I do get the directory error as expected:
$ exercism submit $HOME/Exercism/andrerfcsantos-exercism/go/hello-world
Error:
You are submitting a directory, which is not currently supported.
/Users/andre.santos/Exercism/andrerfcsantos-exercism/go/hello-world
Please change into the directory and provide the path to the file(s) you wish to submit
exercism submit FILENAME
$ exercism submit $HOME/Exercism/andrerfcsantos-exercism/go/hello-world/hello_world.go
Your solution has been submitted successfully.
View it at:
https://exercism.org/tracks/go/exercises/hello-world
So, this seems to confirm the CLI is correctly identifying a directory vs file.
More information on the specific path could help us try to reproduce what you are saying:
- Does it have spaces or any special characters?
- What’s the result of
stat $HOME/hello_world.go
?
It seems that the workspace directory for the cli is configured to be /Users/USERNAME/Exercism
, but you are working in /Users/USERNAME/exercism
, which are two different folders. It’s not up to the CLI to try to treat these as equal. If the filesystem/operating system treats them differently, the CLI should honor that too.
If all your stuff for Exercism is in /Users/USERNAME/exercism
, maybe you can make that your workspace? You can change your workspace with:
exercism config -w "/Users/USERNAME/exercism"
In any case, to submit your solutions despite all of these issues, you can run exercism submit
with no arguments or exercism submit <solution_file1> [solution_file2]
inside the exercise directory like others suggested before.