-
Notifications
You must be signed in to change notification settings - Fork 51
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
--recursive flag for some fs
commands
#232
Comments
not sure i want to have recursive on everything. where it makes more sense like copy/move/remove ya, but is path newer feels a bit strange.
|
That would still result in a bit of a mouthful: target = glob_array build/**/*
src = glob_array src/**/*
any_newer = false
for src_file in ${src}
for target_file in ${target}
if is_path_newer ${src_file} ${target_file}
any_newer = true
end
end
end
if ${any_newer}
# My actual behaviour
end But in the end all I would personally need is sagiegurari/cargo-make#611 (comment) |
your code is wrong. you don't need to walk and glob both source and target. |
Depends on whether the target folder gets touched with every build, but that is probably true in most cases. |
but you are comparing EVERY source file with EVERY target file. thats wrong. no way you need to do that. if you glob on both and compare all, why would comparing src/file.src with target/file2.bin will help? file1 and file2 are unrelated. |
Depends on your language if there is a one to one mapping of build artifacts to src files |
again, based on source you create the target files to check. you don't glob. |
That is probably true, but I'd rather take the cost of comparing every file with every file than actually figuring out the exact mapping, that's also why sagiegurari/cargo-make#611 (comment) would be sufficient for my use. Probably a better way to do it would be iterating over both folders and just take the highest timestamp, tho. |
Feature Description
Sometimes it can be quite useful to operate not only on a directory but also all subdirs.
Therefore, I'd like an easy way to get all files in a file tree or compare if any file in one dir is newer than another path.
Describe The Solution You'd Like
a recursive flag for commands like
ls
oris_path_newer
.For
ls
the behavior is easily defined: just print all files of any subpath.For
is_path_newer
there are technically 3 different possible behaviors:For my use case, any of these would be fine (I just want to know if any file in the src dir is newer than the build dir), but they could also be made available as 2-3 different flags:
There are probably other commands that would benefit from this as well.
The text was updated successfully, but these errors were encountered: