add {COPYFILEIFNEWER} token#2617
Conversation
nickclark2016
left a comment
There was a problem hiding this comment.
Changes look good, just that comment on the Tokens table and we'll be good to merge this.
website/docs/Tokens.md
Outdated
| |------------|---------------------------------------------|-----------------------|-------| | ||
| | {CHDIR} | chdir {args} | cd {args} | | | ||
| | {COPYFILE} | copy /B /Y {args} | cp -f {args} | | | ||
| | {COPYFILEIFNEWER} | xcopy /D /Y {args}* | cp -u {args} | 5.0-beta9 | |
There was a problem hiding this comment.
Sorry for the late response. You don't need the "Since" field, since this will just be present in 5.0 stable (next release).
|
Tests fail. Please fix. |
12df880 to
a0a2623
Compare
fixed. checks out okay here. Thanks for the review! |
tests/base/test_os.lua
Outdated
| end | ||
|
|
||
| function suite.translateCommand_windowsCopyFileIfNewerWithPaths() | ||
| test.isequal('xcopy /D /Y src\\dir\\file.txt dst\\dir\\file.txt*', os.translateCommands('{COPYFILEIFNEWER} src/dir/file.txt dst/dir/file.txt', "windows")) |
There was a problem hiding this comment.
paths should be enclosed by %[..] i.e 'xcopy /D /Y %[src\\dir\\file.txt dst\\dir\\file.txt*]'
There was a problem hiding this comment.
Good catch here. I would agree this should be fixed.
tests/base/test_os.lua
Outdated
| end | ||
|
|
||
| function suite.translateCommand_windowsCopyFileIfNewerWithPaths() | ||
| test.isequal('xcopy /D /Y src\\dir\\file.txt dst\\dir\\file.txt*', os.translateCommands('{COPYFILEIFNEWER} src/dir/file.txt dst/dir/file.txt', "windows")) |
There was a problem hiding this comment.
Good catch here. I would agree this should be fixed.
What does this PR do?**
Adds a
{COPYIFNEWER}command token that copies a file only if the source is newer than the destination, or the destination doesn't exist.How does this PR change Premake's behavior?
No breaking changes. Existing behavior is untouched. This just adds a new
{COPYIFNEWER}token alongside the existing{COPY},{COPYFILE}, etc.Anything else we should know?
Nothing.
Did you check all the boxes?