File tree 2 files changed +5
-2
lines changed
2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -14,13 +14,16 @@ mod cmd_line;
14
14
use cmd_line:: Cli ;
15
15
16
16
fn main ( ) -> std:: io:: Result < ( ) > {
17
+ let out_dir =
18
+ std:: path:: PathBuf :: from ( std:: env:: var_os ( "OUT_DIR" ) . ok_or ( std:: io:: ErrorKind :: NotFound ) ?) ;
19
+
17
20
let cmd: clap:: Command = Cli :: command ( ) ;
18
21
19
22
let man = clap_mangen:: Man :: new ( cmd) ;
20
23
let mut buffer: Vec < u8 > = Default :: default ( ) ;
21
24
man. render ( & mut buffer) ?;
22
25
23
- std:: fs:: write ( "newdoc.1" , buffer) ?;
26
+ std:: fs:: write ( out_dir . join ( "newdoc.1" ) , buffer) ?;
24
27
25
28
Ok ( ( ) )
26
29
}
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ install -m 0755 target/release/%{name} %{buildroot}%{_bindir}/%{name}
41
41
# An alternative way to install the binary using cargo.
42
42
# cargo install --path . --root %{buildroot}/usr
43
43
# Compress the man page
44
- gzip %{name }.1
44
+ gzip -c target/release/build/ %{name }- * /out/%{ name }.1 > %{ name }.1.gz
45
45
# Install the man page into the chroot environment.
46
46
install -m 0644 %{name }.1.gz %{buildroot }%{_mandir }/man1/%{name }.1.gz
47
47
You can’t perform that action at this time.
0 commit comments