GithubHelp home page GithubHelp logo

yonaskolb / genesis Goto Github PK

View Code? Open in Web Editor NEW
191.0 5.0 18.0 93 KB

Templating, scaffolding and generation tool

License: MIT License

Swift 96.33% C 0.11% Makefile 3.56%
cli templating scafolding tool swift yaml generator

genesis's People

Contributors

aomathwift avatar guseducampos avatar janiduw avatar noppefoxwolf avatar yonaskolb avatar yutailang0119 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

genesis's Issues

Array options arguments support

It would be great to be able to pass specific options array like this.
I am currently trying this implementation. If it goes well I will submit a PR.

If anyone has any other ideas on how to pass options, please let me know here.

-- options name: MyProject, targets.name: MyTarget, targets.type: application

or

-- options "name: MyProject, targets: [name: MyTarget, type: application]"

Feature -- allow for git repositories

As a user I want to be able to pass a git repository instead of a template.yml file so that I can maintain my own templates and make use of community templates.

use:

$ mkdir HappyDance && cd HappyDance
$ genesis generate https://github.com/thecb4/GenesisTemplate
  1. It should allow for http || https || git protocols
  2. It should download to a common folder
        // replace the standard path call with one that checks the string and does some work 
        // let templatePath = Path(self.templatePath.value).absolute()
        let templatePath = determinePath(from: self.templatePath.value)
    /**
      This method allows for the use of git repositories to hold templates in addition to passing in a flat template file.

      - Parameter from: The string passed in from the command line
      - Returns: Returns the Path of the template file

      ## Important Notes ##
      1. template.yml file should be top level of the git repository
      2. template repositories will be downloaded to a .genesis folder in users home (~) directory
      3. Each download replaces prior versions of the template

    */
    func determinePath(from: String) -> Path {

      if
        from.contains("http")  ||
        from.contains("https") ||
        from.contains("git")
      {

        do {

          let project = URL(string: from)!.lastPathComponent.components(separatedBy: ".")[0]

          let mkdirCommand  = try shellOut(to: "ls .genesis 2>/dev/null || mkdir .genesis", at: "~")

          print("removing existing template")
          let deleteCommand = try shellOut(to: "rm -rf .genesis/\(project)", at: "~")

          print("cloning repository")
          let cloneCommand = try shellOut(to: "git clone --verbose \(from)", at: "~/.genesis")

          return Path("~/.genesis/\(project)/template.yml").absolute()

        } catch {

          print(error)
          exit(1)

        }

      } else {

        return Path(from).absolute()

      }

    }

Glob support

Would be great if you could glob paths like this. I am currently hacking on a workaround, will submit a PR if I get it working.

files:
  - template: "**/*.swift"

Is there any ways to continue to input options if needed?

I want to input some options if I want to input those. Is there any ways to do this?
For example, I want to generate such file if I want to use Firebase.

{% if firebase %}
FIREBASE_APP_ID = '{{ firebase.app_id }}'
FIREBASE_CI_TOKEN = '{{ firebase.ci_token }}'
FIREBASE_APP_DISTRIBUTION_GROUP = '{{ firebase.app_distribution_group }}'
{% endif %}

This feature may be able to be realized as single attempt of array input option, but I couldn't find how to input options only once.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.