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

feat: modify init command to not use placeholders #243

Merged
merged 5 commits into from
Sep 9, 2021

Conversation

namit-chandwani
Copy link
Member

@namit-chandwani namit-chandwani commented Sep 2, 2021

Closes #239

Description

  • The init command of Charmil CLI uses the template files and their placeholders that are currently present in the charmil-starter repo to generate a starter project, which makes the charmil-starter repo unusable without the init command (ie. users cannot clone the repo and use it directly due to the presence of template files).

  • Our aim is to provide an additional option for users to use Charmil Starter by allowing them to directly clone the charmil-starter Github repository.

  • This can be achieved by following these 2 steps:

    • Change the init command implementation to replace default values with the user-specified ones (ie. Github org/user name, repo name and CLI name) by performing simple String replacements instead of using go templates and substituting its placeholders.
      [Handled by this PR]

    • Remove the current contents of the charmil-starter repo (as it contains template files instead of runnable code) and replace it with the contents of the starter present in this repo (charmil/starter).
      [Handled by the PR: chore: replace current repo contents with charmil/starter charmil-starter#7]

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation change
  • Other (please specify)

Checklist

  • Documentation added for the feature
  • CI and all relevant tests are passing
  • Code Review completed
  • Verified independently by reviewer

@namit-chandwani namit-chandwani marked this pull request as ready for review September 3, 2021 17:01
@namit-chandwani
Copy link
Member Author

This PR is now ready for review :)

CC: @wtrocki

@wtrocki
Copy link
Contributor

wtrocki commented Sep 3, 2021

ETA 1 day. Weekend

starter/Makefile Outdated Show resolved Hide resolved
Copy link
Contributor

@wtrocki wtrocki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good stuff but left some suggestions

@wtrocki
Copy link
Contributor

wtrocki commented Sep 4, 2021

I do not think all uses of cli name were properly replaced :)

@namit-chandwani
Copy link
Member Author

good stuff but left some suggestions

Sorry, missed the notification somehow.
Will make the required changes tomorrow :)

@namit-chandwani
Copy link
Member Author

Merging this PR now and making a new Charmil release for both charmil/starter module and charmil-starter repo to use.

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

Successfully merging this pull request may close these issues.

Modify charmil init command to replace text using regex instead of placeholders
2 participants