liftoffcli / liftoff

CLI for creating and configuring new Xcode projects
MIT License
1.6k stars 104 forks source link

Liftoff crashes on creating a dot file #279

Closed mergesort closed 8 years ago

mergesort commented 8 years ago

I'm trying to add .swiftlint.yml into my project, so that way we have default linting rules setup for everyone.

I added a template named swiftlint.yml into the templates folder, (and before tried .swiftlint.yml but that didn't work either). I then added - <%= "." %>swiftlint.yml into my .liftoffrc, resembling this.

swift:
  - <%= '.' %>swiftlint.yml
  - <%= project_name %>:
  - Modules:

If I remove the '.' prefix, it works fine, but when I run liftoff with a leading period, I get this result now.

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:245:in `mkdir': No such file or directory -  (Errno::ENOENT)
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:245:in `fu_mkdir'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:219:in `block (2 levels) in mkdir_p'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:217:in `reverse_each'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:217:in `block in mkdir_p'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:203:in `each'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:203:in `mkdir_p'
    from /usr/local/Cellar/liftoff/1.8.1/rubylib/liftoff/file_manager.rb:23:in `mkdir_gitkeep'
    from /usr/local/Cellar/liftoff/1.8.1/rubylib/liftoff/project_builder.rb:31:in `add_file'
    from /usr/local/Cellar/liftoff/1.8.1/rubylib/liftoff/project_builder.rb:24:in `create_tree'
    from /usr/local/Cellar/liftoff/1.8.1/rubylib/liftoff/project_builder.rb:12:in `block (2 levels) in create_project'
    from /usr/local/Cellar/liftoff/1.8.1/rubylib/liftoff/project_builder.rb:11:in `each'
    from /usr/local/Cellar/liftoff/1.8.1/rubylib/liftoff/project_builder.rb:11:in `block in create_project'
    from /usr/local/Cellar/liftoff/1.8.1/rubylib/liftoff/project_builder.rb:10:in `each'
    from /usr/local/Cellar/liftoff/1.8.1/rubylib/liftoff/project_builder.rb:10:in `create_project'
    from /usr/local/Cellar/liftoff/1.8.1/rubylib/liftoff/launchpad.rb:63:in `generate_project'
    from /usr/local/Cellar/liftoff/1.8.1/rubylib/liftoff/launchpad.rb:15:in `block in liftoff'
    from /usr/local/Cellar/liftoff/1.8.1/rubylib/liftoff/file_manager.rb:5:in `chdir'
    from /usr/local/Cellar/liftoff/1.8.1/rubylib/liftoff/file_manager.rb:5:in `create_project_dir'
    from /usr/local/Cellar/liftoff/1.8.1/rubylib/liftoff/launchpad.rb:14:in `liftoff'
    from /usr/local/Cellar/liftoff/1.8.1/rubylib/liftoff/cli.rb:10:in `run'
    from /usr/local/bin/liftoff:14:in `<main>'

Thanks a lot for the tool, it's fantastic! Any suggestions, or anything I may have missed?

mergesort commented 8 years ago

Just wanted to bump this issue. Big fan of liftoff, would love to see if it's possible to implement this!

marcelofabri commented 8 years ago

Couldn't you like this: https://github.com/thoughtbot/liftoff/blob/master/defaults/liftoffrc#L28 ?

gfontenot commented 8 years ago

Yeah, I'd avoid the swift template for this and use the templates key instead. It's annoying that we have both of those. templates is intended to be used for non-source files while the app template whatever is intended to be used for files that will be compiled (or copied or whatever) into your app.

mergesort commented 8 years ago

Ah, I didn't realize that, will close. Thanks a lot!