Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/base/premake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -168,14 +168,19 @@
error(err, 0)
end

local fileexists = os.isfile(fn)
local f, err = os.writefile_ifnotequal(output, fn);

if (f == 0) then
return false -- file not modified
elseif (f < 0) then
error(err, 0)
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.

else
printf("Generated %s... [New]", path.getrelative(_WORKING_DIR, fn))
end
return true -- file modified
end
end
Expand Down