question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Update procedure for changed variables

See original GitHub issue

What is the intended way to update a project in case of a changed variable in .cruft.json? Looks like a feature for this is missing because only the git commit is checked, not changes in this file.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:6
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
benlindsaycommented, Feb 17, 2021

Cruft looks like an awesome tool, thanks for building it! Being able to change variables whether or not the template has changed would be a great feature, and one that copier does. From my perspective, if this could be implemented in cruft, then all the main features I like about copier would be available to cookiecutter.

1reaction
brisbergcommented, Nov 25, 2020

I think I see what @languitar is getting at: It would be nice to be able to alter cruft variables and apply the generated diff even if the template is currently up to date.

Example:

I feel I am ready to put out a new release for projectFoo which is currently on v1.0.0. Before I do so I want to grab the latest cruft boilerplate and make sure it works correctly.

cruft update
yarn test
git add .
git commit -m "Cruft Updates"

Now it is time for a version bump and then a release:

cruft update -i
# Alter the 'version' cruft variable to `1.1.0`
git add .
git commit -m "Release v1.1.0"
git tag v1.1.0

As it stands this workflow is not possible because after the first cruft update the project and template are in-sync and cruft update -i will not re-trigger the variable prompt.


Is there currently an update mechanism to make this workflow possible?

Read more comments on GitHub >

github_iconTop Results From Across the Web

2.11. Updating Variables - Runestone Academy
Updating a variable by adding 1 is called an increment; subtracting 1 is called ... There are also instructions for installing Python on...
Read more >
Change variable within SQL Server stored procedure
Is there any way to access the stored procedure variable and change a variable within it before it executes? The variable I want...
Read more >
How do I modify (edit) variables with the web based process ...
Click on the variable you want to modify (edit). Enter the new value of the variable Then click on the Save button to...
Read more >
Update work notes if variable changes - ServiceNow Community
Solved: Hello, I have an order guide/catalog item that uses a variable set and the variables are cascaded. If someone changes a variable...
Read more >
How to update variables for a user after their attribute changes?
To make sure users get the latest variables based on their attributes, you can call Leanplum.forceContentUpdate() method after the attributes are set. This...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found