Closed crabonature closed 6 years ago
This is interesting. It seems this works fine for me in version 0.4.0, but I do get this error in 0.5.0. I'm not sure what changed exactly between the two, but that may be worth investigating.
Strange that it could works before because in code there is reevaluation of whole command stack when every new command is issued, so it was probably always error for second rmdir("xx") evaluation, because this dir was removed at previous instruction evaluation. https://github.com/crystal-community/icr/blob/6dabbef34e3223fe08ff337ded13e873cd369c60/src/icr/executer.cr#L20 This line of execution changed since 0.4.0, because of Crystal changes: https://github.com/crystal-community/icr/blob/6dabbef34e3223fe08ff337ded13e873cd369c60/src/icr/executer.cr#L24
When I try to use
Dir.mkdir()
inicr
the next instructions always will fail with error complaining about it exists. From source code it's just trying to runmkdir()
on every recompilation and thats why error shows.The same goes for
Dir.rmdir()
andDir.mkdir_p()
.