GithubHelp home page GithubHelp logo

dnaka91 / cargo-hatch Goto Github PK

View Code? Open in Web Editor NEW
7.0 0.0 1.0 151 KB

Hatch new projects like a chick coming out of its egg

License: GNU Affero General Public License v3.0

Rust 100.00%
cargo-plugin templates hacktoberfest

cargo-hatch's Introduction

@dnaka91's Holopin board

cargo-hatch's People

Contributors

dnaka91 avatar modprog avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

modprog

cargo-hatch's Issues

implement init

Just so that I'm not as confused when I run cargo hatch init next time and expect it to do something

conditional settings

add a condition similarly to the file ignores to arguments to allow only querying some options when an earlier prompt was answered with yes.

[bin_install]
type = "bool"
description = "Enable binary installer (requires releases on GitHub)"
default = true

[github_repo]
type = "string"
description = "Enable binary installer (requires releases on GitHub)"
condition = "{{ bin_install }}"

should only ask for github_repo if bin_install is answered with yes.

Only allow using the current path if empty or explicitly specified

I just created the project in my parent directory by accident.

I think there is a reason many tools only allow using an existing directory if it is empty.

Maybe a compromise could be to either ask "Are you sure you want to hatch in this non empty directory direcotry_name?" or require passing the current directory as . .

I hope I don't anoy you too much with these issues. It's a great tool, and I really enjoy using it.

Support dynamic defaults

I have a variable that is the project_name by default, but can be changed.

I'd like to be able to do something like:
default = "{{project_name}}"

Updating a template

We discussed this earlier, but I have a few ideas that should make this viable:

  1. from from either a tag e.g. "0.1" or from a commit sha 0c4a3.
  2. Modes for cleaning up files generated by from version
    a. force-clean: Delete all files that were created by from version
    b. try-clean: Check if any files created by from version were changed, if yes fail.
    c. partial-clean: Only delete all the files that were not changed
  3. Modes for generating new files
    a. force-gen: Replace existing files with newly generated ones
    b. try-gen: Fail if any files would be overwritten
    c. partial-gen: Only generate files that would not overwrite existing ones.
  4. Have combined modes, i.e. force, try, partial
  5. For values:
    a. have some form of input file
    b. just respecify all the values, as they might have changed from version to version as well.

With a vc project you can just use force and than have a look at the diff.

Path filters

Not sure if this is something that should be done in tera, but we could also just add these our selves.

Specifically, I'd like a file_name filter to get the name of the path in project_name

Also, the name project_name is a bit confusing as it actually just is the relative/absolute path, that often ends up just being a dir name.

Dynamic Validation

My Idea would be to have it run with the context of already specified arguments (Hopefully we find a good way to do this in #8).

  • if it evaluates to only whitespace the value is valid
  • else the result is printed as error message

Dynamic values

Same behavior as with defaults (using json for encoding of list and multi_list).

My usecase:

First question selects a set of features.

Second question selects one of them as default: should only offer the ones selected in question 1.

custom delimiters for tera

I have a file using terra like templates inside a template.

So having the ability to change the delimter to some other character would be great.

Related tera issue: Keats/tera#343

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.