Skip to content

feat: print [New] or [Updated] in generation output#2672

Open
ak-slongchamps wants to merge 1 commit intopremake:masterfrom
audiokinetic:feat/show_updated_vs_new
Open

feat: print [New] or [Updated] in generation output#2672
ak-slongchamps wants to merge 1 commit intopremake:masterfrom
audiokinetic:feat/show_updated_vs_new

Conversation

@ak-slongchamps
Copy link
Copy Markdown
Contributor

What does this PR do?

Prints [New] or [Updated] next to the generated files when they have been touched on the filesystem.

How does this PR change Premake's behavior?

Adds extra info to pre-exiting output.
Uses global _WORKING_DIR instead of calling os.getcwd() as a minor optimization.
Adds a filesystem access to determine if the file existed prior.

Anything else we should know?

Useful to know when files are new vs updated

Did you check all the boxes?

  • Focus on a single fix or feature; remove any unrelated formatting or code changes
  • Add unit tests showing fix or feature works; all tests pass
  • Mention any related issues (put closes #XXXX in comment to auto-close issue when PR is merged)
  • Follow our coding conventions
  • Minimize the number of commits
  • Align documentation to your changes

You can now support Premake on our OpenCollective. Your contributions help us spend more time responding to requests like these!

Comment thread src/base/premake.lua
elseif (f > 0) then
printf("Generated %s...", path.getrelative(os.getcwd(), fn))
if fileexists then
printf("Generated %s... [Updated]", path.getrelative(_WORKING_DIR, fn))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This feels like we should do this only in the case of the "verbose" flag. If it's not specified, it should be using the original behavior.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Would also be nice to avoid duplicating the printf so that updating the call doesn't require making the same change in multiple places.

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.

4 participants