crystal init app crash

Created on 1 Nov 2019  路  6Comments  路  Source: crystal-lang/crystal

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] ???
bug topicfiles

Most helpful comment

@asterite I guess you are thinking of #8119

All 6 comments

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

grosser picture grosser  路  3Comments

cjgajard picture cjgajard  路  3Comments

oprypin picture oprypin  路  3Comments

will picture will  路  3Comments

lbguilherme picture lbguilherme  路  3Comments