From 041e9249672bdd22a397f718085b18b41787bef9 Mon Sep 17 00:00:00 2001 From: lyon Date: Mon, 31 Jan 2022 00:15:47 +0800 Subject: [PATCH] skip if requestment.txt no found --- tools/pikaCompiler/src/compiler.rs | 2 +- tools/pikaCompiler/src/version_info.rs | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/pikaCompiler/src/compiler.rs b/tools/pikaCompiler/src/compiler.rs index af52daa87..532827a7d 100644 --- a/tools/pikaCompiler/src/compiler.rs +++ b/tools/pikaCompiler/src/compiler.rs @@ -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)); diff --git a/tools/pikaCompiler/src/version_info.rs b/tools/pikaCompiler/src/version_info.rs index 57af8fb03..11e2fc27f 100644 --- a/tools/pikaCompiler/src/version_info.rs +++ b/tools/pikaCompiler/src/version_info.rs @@ -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; } }