File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ fn copy_with_cp(src: impl AsRef<Path>, dst: impl AsRef<Path>) -> io::Result<()>
6262 Ok ( ( ) )
6363}
6464
65- #[ cfg( not ( target_os = "windows" ) ) ]
65+ #[ cfg( target_os = "linux" ) ]
6666fn copy_with_cp ( src : impl AsRef < Path > , dst : impl AsRef < Path > ) -> io:: Result < ( ) > {
6767 let status = Command :: new ( "cp" )
6868 . arg ( "--no-preserve=mode,ownership" )
@@ -81,6 +81,24 @@ fn copy_with_cp(src: impl AsRef<Path>, dst: impl AsRef<Path>) -> io::Result<()>
8181 }
8282}
8383
84+ #[ cfg( target_os = "macos" ) ]
85+ fn copy_with_cp ( src : impl AsRef < Path > , dst : impl AsRef < Path > ) -> io:: Result < ( ) > {
86+ let status = Command :: new ( "cp" )
87+ . arg ( "-R" )
88+ . arg ( src. as_ref ( ) . to_str ( ) . unwrap ( ) )
89+ . arg ( dst. as_ref ( ) . to_str ( ) . unwrap ( ) )
90+ . status ( ) ?;
91+
92+ if !status. success ( ) {
93+ Err ( io:: Error :: new (
94+ io:: ErrorKind :: Other ,
95+ "Failed to copy using cp" ,
96+ ) )
97+ } else {
98+ Ok ( ( ) )
99+ }
100+ }
101+
84102fn make_amalgamation ( ) {
85103 let flags = [ "-DSQLITE_ENABLE_COLUMN_METADATA=1" ] ;
86104
You can’t perform that action at this time.
0 commit comments