瀏覽代碼

GOROOT might contains GOPATH, handle permissions.

Steve Thielemann 2 周之前
父節點
當前提交
bf761cb96e
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      src/main.rs

+ 4 - 0
src/main.rs

@@ -319,6 +319,10 @@ fn main() -> Result<()> {
                         let update = latest_status.download_path();
 
                         println!("Clearing GOROOT {}", go_root);
+
+                        // GOROOT might contain GOPATH files
+                        // Fix permissions before attempting to remove.
+                        recursive_remove_readonly(&go_path)?;
                         remove_dir_all(&go_root)?;
                         create_dir_all(&go_root)?;