-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat!: luarocks build backend / compatibility layer #253
Conversation
8da4911
to
1569194
Compare
ecd78aa
to
9b7741d
Compare
858c5e7
to
43e966c
Compare
843b300
to
73766f3
Compare
5f78f6e
to
a61e2cc
Compare
73f561c
to
6fc34f3
Compare
6fc34f3
to
5681236
Compare
5681236
to
2e39ada
Compare
2e39ada
to
70c3fa9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
amazing work!
pub(crate) fn recursive_copy_dir(src: &PathBuf, dest: &Path) -> Result<(), io::Error> { | ||
if src.exists() { | ||
for file in walkdir::WalkDir::new(src) | ||
.into_iter() | ||
.flatten() | ||
.filter(|file| file.file_type().is_file()) | ||
{ | ||
let relative_src_path: PathBuf = | ||
pathdiff::diff_paths(src.join(file.clone().into_path()), src) | ||
.expect("failed to copy directories!"); | ||
let filepath = file.path(); | ||
let target = dest.join(relative_src_path); | ||
std::fs::create_dir_all(target.parent().unwrap())?; | ||
std::fs::copy(filepath, target)?; | ||
} | ||
} | ||
Ok(()) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit(for a different PR): I believe we already vendor (or wanted to vendor) a library that has a recursive copy function with the ability to add globs to customize the output.
Important
This is a breaking change, as rocks are now installed in a
tree
subdirectory of the rocks data directory.This PR's implementation assumes that luarocks build backends don't use other custom build backends to build,
which I think is a pretty safe assumption.