Comments (8)
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.
how about using the glob command?
handle = glob_array ./somedir/**/*.txt
for path in ${handle}
echo ${path}
end
from duckscript.
how about using the glob command?
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)
from duckscript.
your code is wrong. you don't need to walk and glob both source and target.
only source.
that makes the code half the size.
from duckscript.
your code is wrong. you don't need to walk and glob both source and target. only source. that makes the code half the size.
Depends on whether the target folder gets touched with every build, but that is probably true in most cases.
from duckscript.
but you are comparing EVERY source file with EVERY target file. thats wrong. no way you need to do that.
you have
src/file1.src
src/file2.src
target/file1.bin
target/file2.bin
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.
from duckscript.
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
from duckscript.
again, based on source you create the target files to check. you don't glob.
and i think there is no way that every source file needs to be checked against every target file.
so is newer onglobs makes, at the moment, little sense to me.
give me one use case please.
from duckscript.
and i think there is no way that every source file needs to be checked against every target file.
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.
from duckscript.
Related Issues (20)
- Feature Request - echo Colored Text HOT 6
- Command to get file size HOT 1
- Zip/unzip command HOT 6
- Using multiple backslashes results in only a single one HOT 4
- Embed Examples HOT 2
- Run commands in exec/Get stdout from eval/Add some form of command substitution HOT 5
- Passing stdin with exec HOT 4
- Upgrade regex package versions to >=1.5.5 (security vulnerabilities) HOT 1
- Newline Escapes HOT 3
- AUR package for duckscript HOT 2
- glob follows symlinks recursively HOT 3
- mv file.rs new_file.rs does not work HOT 5
- Confusion about condition statement HOT 6
- public new release after security fix from ftp crate
- Support array spread in exec HOT 7
- How to change a directory's name HOT 4
- `replace` can not accept a unicode character like \u{FEFF} HOT 1
- `if eq` does not support empty strings HOT 2
- WebAssembly HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from duckscript.