File tree Expand file tree Collapse file tree 4 files changed +23
-4
lines changed
Expand file tree Collapse file tree 4 files changed +23
-4
lines changed Original file line number Diff line number Diff line change 11[package ]
22name = " drem"
3- version = " 0.2.0 "
3+ version = " 0.2.1 "
44edition = " 2021"
55
66# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ echo " Building a release version of the project..."
4+ cargo build --release
5+
6+ echo " Copying the binary to the target directory..."
7+ echo " Current directory: $( pwd) "
8+ sudo cp target/release/drem /usr/local/bin/drem
9+
10+ echo " Done!"
Original file line number Diff line number Diff line change @@ -8,7 +8,13 @@ use std::{
88use zip:: ZipArchive ;
99
1010fn files_exist_in_archive ( drgtk : & PathBuf , files : & [ & str ] ) -> bool {
11- let reader = File :: open ( drgtk) . unwrap ( ) ;
11+ let reader = match File :: open ( drgtk) {
12+ Ok ( file) => file,
13+ Err ( error) => {
14+ eprintln ! ( "Could not open DRGTK: {}" , error) ;
15+ return false ;
16+ }
17+ } ;
1218 let mut archive = ZipArchive :: new ( reader) . unwrap ( ) ;
1319 let mut result = true ;
1420 for file_name in files {
@@ -116,8 +122,9 @@ fn build_new_subcommand() -> Command {
116122}
117123
118124fn build_command ( ) -> Command {
125+ let version = env ! ( "CARGO_PKG_VERSION" ) ;
119126 Command :: new ( "drem" )
120- . version ( "0.2.0" )
127+ . version ( version )
121128 . subcommand ( build_new_subcommand ( ) )
122129}
123130
@@ -135,10 +142,12 @@ fn main() {
135142 }
136143 Err ( e) => {
137144 println ! ( "Error: {}" , e) ;
145+ std:: process:: exit ( 1 ) ;
138146 }
139147 }
140148 } else {
141149 println ! ( "DRGTK is not a valid macOS archive" ) ;
150+ std:: process:: exit ( 1 ) ;
142151 }
143152 }
144153 }
You can’t perform that action at this time.
0 commit comments