Linux, 0.29 or 0.31.1, x86
# crystal init app m
Error opening file 'm/.gitignore' with mode 'w': No such file or directory (Errno)
Unhandled exception: Error opening file 'crystal' with mode 'r': No such file or directory (Errno)
Failed to raise an exception: END_OF_STACK
[0x55ffff71d4f6] ???
[0x55fffedf16c9] __crystal_raise +153
[0x55fffedf2395] ???
[0x55fffedfdbc3] ???
[0x55fffedf6dac] ???
[0x55fffedf6455] ???
[0x55ffff15486a] ???
[0x55ffff164189] ???
[0x55fffedf49d7] main +55
[0x7f1c1c541229] ???
It seems to be a problem with a single letter.
For example if I use "mm", it works:
$ crystal init app mm
create mm/.gitignore
create mm/.editorconfig
create mm/LICENSE
create mm/README.md
create mm/.travis.yml
create mm/shard.yml
create mm/src/mm.cr
create mm/spec/spec_helper.cr
create mm/spec/mm_spec.cr
Initialized empty Git ...
It's bug in file.cr method #dirname.
This code:
full_path = "m/.gitignore"
puts "Full path: #{full_path} dir name: #{File.dirname(full_path)}"
prints:
Full path: m/.gitignore dir name: .
I will look at it.
What Crystal version? Because I remember a similar bug and it should be already fixed in master (and maybe in 0.31.1, not sure)
Oh, nevermind, I just tried it and it's broken in 0.31.1
@asterite I guess you are thinking of #8119
Closed by #8415
Most helpful comment
@asterite I guess you are thinking of #8119