fix(installer): remove redundant clone (#9098)

This commit is contained in:
Bert Belder 2021-01-12 04:55:09 -08:00 committed by GitHub
parent fd56fa89f3
commit de0ae3a12c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -48,7 +48,7 @@ fn validate_name(exec_name: &str) -> Result<(), AnyError> {
/// A second compatible with git bash / MINGW64
/// Generate batch script to satisfy that.
fn generate_executable_file(
file_path: PathBuf,
mut file_path: PathBuf,
args: Vec<String>,
) -> Result<(), AnyError> {
let args: Vec<String> = args.iter().map(|c| format!("\"{}\"", c)).collect();
@ -61,8 +61,7 @@ fn generate_executable_file(
// write file for bash
// create filepath without extensions
let mut copy_path = file_path.clone();
copy_path.set_extension("");
file_path.set_extension("");
let template = format!(
r#"#!/bin/sh
# generated by deno install
@ -70,7 +69,7 @@ deno {} "$@"
"#,
args.join(" "),
);
let mut file = File::create(&copy_path)?;
let mut file = File::create(&file_path)?;
file.write_all(template.as_bytes())?;
Ok(())
}