-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create swarm subdirectories as necessary #943
Conversation
xsebek
commented
Jan 1, 2023
•
edited
Loading
edited
- fixes Crash after completing the first step of the tutorial #941
src/Swarm/Util.hs
Outdated
@@ -259,7 +259,7 @@ getDataFileNameSafe name = do | |||
|
|||
dataNotFound :: FilePath -> IO Text | |||
dataNotFound f = do | |||
d <- getSwarmDataPath False | |||
d <- getSwarmDataPath False "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I take it that the empty string represents "no subdirectory", i.e. the "current directory"? Perhaps a Maybe
would convey the intentions better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's how path works - a//./
is the same as a
.
A good solution might be to use a different function or make a proper ADT type for our sources. 🤔
We should refactor this code and document it better, but let’s do that in a new PR.
@xsebek what's the status of this? Were you going to do more testing or can it be merged? |
@byorgey it definitely needs to be tested, because it is wrong! 😅
|