mirror of
https://github.com/ouch-org/ouch.git
synced 2025-06-07 20:15:27 +00:00
fix windows ci run failed
Signed-off-by: tommady <tommady@users.noreply.github.com>
This commit is contained in:
parent
c706a3a9b1
commit
a8beca2c08
@ -238,7 +238,9 @@ where
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#[cfg(unix)]
|
||||||
let mode = metadata.permissions().mode();
|
let mode = metadata.permissions().mode();
|
||||||
|
|
||||||
let entry_name = path.to_str().ok_or_else(|| {
|
let entry_name = path.to_str().ok_or_else(|| {
|
||||||
FinalError::with_title("Zip requires that all directories names are valid UTF-8")
|
FinalError::with_title("Zip requires that all directories names are valid UTF-8")
|
||||||
.detail(format!("File at '{path:?}' has a non-UTF-8 name"))
|
.detail(format!("File at '{path:?}' has a non-UTF-8 name"))
|
||||||
@ -255,7 +257,11 @@ where
|
|||||||
|
|
||||||
// This approach writes the symlink target path as the content of the symlink entry.
|
// This approach writes the symlink target path as the content of the symlink entry.
|
||||||
// We detect symlinks during extraction by checking for the Unix symlink mode (0o120000) in the entry's permissions.
|
// We detect symlinks during extraction by checking for the Unix symlink mode (0o120000) in the entry's permissions.
|
||||||
|
#[cfg(unix)]
|
||||||
let symlink_options = options.unix_permissions(0o120000 | (mode & 0o777));
|
let symlink_options = options.unix_permissions(0o120000 | (mode & 0o777));
|
||||||
|
#[cfg(windows)]
|
||||||
|
let symlink_options = options.unix_permissions(0o120777);
|
||||||
|
|
||||||
writer.add_symlink(entry_name, target_name, symlink_options)?;
|
writer.add_symlink(entry_name, target_name, symlink_options)?;
|
||||||
} else {
|
} else {
|
||||||
#[cfg(not(unix))]
|
#[cfg(not(unix))]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user