Skip to content
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

Liftoff doesn't use local templates if path argument provided #236

Open
brandonroth opened this issue Aug 24, 2015 · 3 comments
Open

Liftoff doesn't use local templates if path argument provided #236

brandonroth opened this issue Aug 24, 2015 · 3 comments

Comments

@brandonroth
Copy link

if I put provide a .liftoffrc file along with some templates in .liftoff/templates and then use liftoff and specify where I would like the project to go by using liftoff ~/Desktop/testProject then liftoff uses the local .liftoffrc file but ignores the templates and fails. If I omit the last path argument then everything works as expected.

I envision installing liftoff and then everyone clones a git repo that includes a well thought out .liftoffrc file along with a directory of templates. Whenever it's time for a new project you do a pull of the repo and run liftoff. As is this works you just have to omit the path and then manually move the directory after liftoff is done doing its thing.

This is the error I get

/usr/local/Cellar/liftoff/1.5.0/rubylib/liftoff/file_manager.rb:74:in read': No such file or directory - /usr/local/Cellar/liftoff/1.5.0/templates/ArrayExtensions.swift (Errno::ENOENT) from /usr/local/Cellar/liftoff/1.5.0/rubylib/liftoff/file_manager.rb:74:inrender_template'
from /usr/local/Cellar/liftoff/1.5.0/rubylib/liftoff/file_manager.rb:66:in move_template' from /usr/local/Cellar/liftoff/1.5.0/rubylib/liftoff/file_manager.rb:36:increate_template_file'
from /usr/local/Cellar/liftoff/1.5.0/rubylib/liftoff/file_manager.rb:17:in generate' from /usr/local/Cellar/liftoff/1.5.0/rubylib/liftoff/project_builder.rb:58:inmove_template'
from /usr/local/Cellar/liftoff/1.5.0/rubylib/liftoff/project_builder.rb:32:in add_file' from /usr/local/Cellar/liftoff/1.5.0/rubylib/liftoff/project_builder.rb:24:increate_tree'
from /usr/local/Cellar/liftoff/1.5.0/rubylib/liftoff/project_builder.rb:44:in block (2 levels) in create_groups_for_tree' from /usr/local/Cellar/liftoff/1.5.0/rubylib/liftoff/project_builder.rb:43:ineach'
from /usr/local/Cellar/liftoff/1.5.0/rubylib/liftoff/project_builder.rb:43:in block in create_groups_for_tree' from /usr/local/Cellar/liftoff/1.5.0/rubylib/liftoff/project_builder.rb:37:ineach_pair'
from /usr/local/Cellar/liftoff/1.5.0/rubylib/liftoff/project_builder.rb:37:in create_groups_for_tree' from /usr/local/Cellar/liftoff/1.5.0/rubylib/liftoff/project_builder.rb:26:increate_tree'
from /usr/local/Cellar/liftoff/1.5.0/rubylib/liftoff/project_builder.rb:44:in block (2 levels) in create_groups_for_tree' from /usr/local/Cellar/liftoff/1.5.0/rubylib/liftoff/project_builder.rb:43:ineach'
from /usr/local/Cellar/liftoff/1.5.0/rubylib/liftoff/project_builder.rb:43:in block in create_groups_for_tree' from /usr/local/Cellar/liftoff/1.5.0/rubylib/liftoff/project_builder.rb:37:ineach_pair'
from /usr/local/Cellar/liftoff/1.5.0/rubylib/liftoff/project_builder.rb:37:in create_groups_for_tree' from /usr/local/Cellar/liftoff/1.5.0/rubylib/liftoff/project_builder.rb:26:increate_tree'
from /usr/local/Cellar/liftoff/1.5.0/rubylib/liftoff/project_builder.rb:12:in block (2 levels) in create_project' from /usr/local/Cellar/liftoff/1.5.0/rubylib/liftoff/project_builder.rb:11:ineach'
from /usr/local/Cellar/liftoff/1.5.0/rubylib/liftoff/project_builder.rb:11:in block in create_project' from /usr/local/Cellar/liftoff/1.5.0/rubylib/liftoff/project_builder.rb:10:ineach'
from /usr/local/Cellar/liftoff/1.5.0/rubylib/liftoff/project_builder.rb:10:in create_project' from /usr/local/Cellar/liftoff/1.5.0/rubylib/liftoff/launchpad.rb:63:ingenerate_project'
from /usr/local/Cellar/liftoff/1.5.0/rubylib/liftoff/launchpad.rb:15:in block in liftoff' from /usr/local/Cellar/liftoff/1.5.0/rubylib/liftoff/file_manager.rb:5:inchdir'
from /usr/local/Cellar/liftoff/1.5.0/rubylib/liftoff/file_manager.rb:5:in create_project_dir' from /usr/local/Cellar/liftoff/1.5.0/rubylib/liftoff/launchpad.rb:14:inliftoff'
from /usr/local/Cellar/liftoff/1.5.0/rubylib/liftoff/cli.rb:10:in run' from /usr/local/bin/liftoff:14:in

'

@jakecraige
Copy link
Contributor

Can you provide the content of the liftoffrc you're using?

@brandonroth
Copy link
Author

test_target_name: UnitTests
configure_git: true
warnings_as_errors: true
enable_static_analyzer: true
indentation_level: 4
use_tabs: false
use_cocoapods: false
enable_settings: true
strict_prompts: false
deployment_target: 8.0

run_script_phases:
  - file: todo.sh
    name: Warn for TODO and FIXME comments

templates:
  - Gemfile.rb: Gemfile
  - test.sh: bin/test
  - setup.sh: bin/setup
  - README.md: README.md

warnings:
  - GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED
  - GCC_WARN_MISSING_PARENTHESES
  - GCC_WARN_ABOUT_RETURN_TYPE
  - GCC_WARN_SIGN_COMPARE
  - GCC_WARN_CHECK_SWITCH_STATEMENTS
  - GCC_WARN_UNUSED_FUNCTION
  - GCC_WARN_UNUSED_LABEL
  - GCC_WARN_UNUSED_VALUE
  - GCC_WARN_UNUSED_VARIABLE
  - GCC_WARN_SHADOW
  - GCC_WARN_64_TO_32_BIT_CONVERSION
  - GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS
  - GCC_WARN_ABOUT_MISSING_NEWLINE
  - GCC_WARN_UNDECLARED_SELECTOR
  - GCC_WARN_TYPECHECK_CALLS_TO_PRINTF
  - GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS
  - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS
  - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF
  - CLANG_WARN_IMPLICIT_SIGN_CONVERSION
  - CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION
  - CLANG_WARN_EMPTY_BODY
  - CLANG_WARN_ENUM_CONVERSION
  - CLANG_WARN_INT_CONVERSION
  - CLANG_WARN_CONSTANT_CONVERSION

xcode_command: open -a 'Xcode' .

project_template: swift

app_target_templates:
  objc:
    - <%= project_name %>:
      - Categories:
      - Protocols:
      - Headers:
      - Models:
      - ViewModels:
      - Controllers:
        - <%= prefix %>AppDelegate.h
        - <%= prefix %>AppDelegate.m
      - Views:
      - Resources:
        - Images.xcassets
        - Storyboards:
          - Main.storyboard
        - Nibs:
          - LaunchScreen.xib
        - Other-Sources:
          - Info.plist
          - <%= project_name %>-Prefix.pch
          - main.m
  swift:
    - <%= project_name %>:
      - API:
      - Extensions:
        - ArrayExtensions.swift
        - DictionaryExtensions.swift
        - NumberExtensions.swift
        - StringExtensions.swift
        - UIImageViewExtensions.swift
        - UILabelExtensions.swift
        - NSBundleExtensions.swift
        - UIColorExtensions.swift
      - Protocols:
      - Models:
      - OtherSources:
        - AppDelegate.swift
        - Constants.swift
      - ViewControllers:
        - ViewController.swift
      - Views:
      - Resources:
        - Images.xcassets
        - Storyboards:
          - Main.storyboard
        - Nibs:
          - LaunchScreen.xib
        - Other-resources:
          - Info.plist
          - Config.debug.xcconfig
          - Config.staging.xcconfig
          - Config.release.xcconfig
          - Config.regression.xcconfig

test_target_templates:
  objc:
    - <%= test_target_name %>:
      - Resources:
        - <%= test_target_name %>-Info.plist
        - <%= test_target_name %>-Prefix.pch
      - Helpers:
      - Tests:
  swift:
    - <%= test_target_name %>:
      - Resources:
        - <%= test_target_name %>-Info.plist
      - Helpers:
      - Tests:

@mats-claassen
Copy link

Something similar happened to me but in my case (apart from setting the path as argument) I was setting the company key at the top.
If I comment the company key it works. If not, then it will take whatever I put there as default company but not use the rest of my liftoffrc config file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants