update resolver
This commit is contained in:
@@ -20,6 +20,11 @@ pub fn resolve_file(script_file: &str) -> XResult<String> {
|
||||
file_sha256,
|
||||
file_name
|
||||
);
|
||||
let cache_file_path_url = format!(
|
||||
"{}/.cache/runrs/{}.url",
|
||||
util::get_user_home_or_die(),
|
||||
file_sha256
|
||||
);
|
||||
debugging!("Cache file: {}", cache_file_path);
|
||||
if let Ok(metadata) = fs::metadata(&cache_file_path) {
|
||||
if metadata.is_file() {
|
||||
@@ -74,7 +79,7 @@ pub fn resolve_file(script_file: &str) -> XResult<String> {
|
||||
if let Err(e) = fs::write(&cache_file_path, remote_script_content) {
|
||||
return simple_error!("Write script: {} failed: {}", cache_file_path, e);
|
||||
}
|
||||
if let Err(_) = fs::write(&format!("{}.url", cache_file_path), script_file) {
|
||||
if let Err(_) = fs::write(&cache_file_path_url, script_file) {
|
||||
// JUST IGNORE
|
||||
}
|
||||
// change script file permission
|
||||
|
||||
Reference in New Issue
Block a user