skip if requestment.txt no found

This commit is contained in:
lyon 2022-01-31 00:15:47 +08:00
parent ee0997076c
commit 041e924967
2 changed files with 9 additions and 1 deletions

View File

@ -56,7 +56,7 @@ impl Compiler {
pub fn analyze_file(mut compiler: Compiler, file_name: String, is_top_pkg: bool) -> Compiler {
println!(
"(pikascript) compiling {}{}.py...",
"(PikaScript) compiling {}{}.py...",
compiler.source_path, file_name
);
let file = File::open(format!("{}{}.py", compiler.source_path, file_name));

View File

@ -20,6 +20,14 @@ impl VersionInfo {
pub fn analyze_file(mut self, source_path: String) -> VersionInfo {
self.source_path = source_path;
let file = File::open(&self.source_path);
let mut file = match file {
Ok(file) => file,
Err(_) => {
println!("(PikaScript) requestment.txt no found.");
return self;
}
};
return self;
}
}