Skip to content

Commit

Permalink
fix install
Browse files Browse the repository at this point in the history
fix install

fix install

fix install

fix install
  • Loading branch information
tsirysndr committed Jul 6, 2024
1 parent a4d01e8 commit e285d71
Showing 1 changed file with 10 additions and 18 deletions.
28 changes: 10 additions & 18 deletions src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,33 +38,25 @@ pub fn setup() -> Result<String, Error> {

let stdout = dag()
.pkgx()?
.with_exec(vec!["mkdir", "-p", &format!("{}/.local/bin", home)])?
.with_exec(vec!["type wget || pkgx install wget"])?
.with_exec(vec![
"sh",
"-c",
&format!("type drone-ssh > /dev/null || pkgx wget https://github.com/appleboy/drone-ssh/releases/download/v{}/drone-ssh-{}-{}-{}", drone_ssh_version, drone_ssh_version, os, arch),
&format!("type drone-ssh > /dev/null || wget https://github.com/appleboy/drone-ssh/releases/download/v{}/drone-ssh-{}-{}-{}", drone_ssh_version, drone_ssh_version, os, arch),
])?
.with_exec(vec![
"sh",
"-c",
&format!("type drone-ssh > /dev/null || chmod a+x drone-ssh-*")])?
&format!("type drone-ssh > /dev/null || chmod a+x drone-ssh-{}-{}-{}", drone_ssh_version, os, arch)])?
.with_exec(vec![
"sh",
"-c",
"type drone-ssh > /dev/null || mv drone-ssh-* $HOME./local/bin/drone-ssh",
&format!("type drone-ssh > /dev/null || mv drone-ssh-{}-{}-{} {}/.local/bin/drone-ssh", drone_ssh_version, os, arch, home),
])?
.with_exec(vec![
"sh",
"-c",
&format!("type drone-scp > /dev/null || pkgx wget https://github.com/appleboy/drone-scp/releases/download/v{}/drone-scp-{}-{}-{}",drone_scp_version, drone_scp_version, os, arch),
&format!("type drone-scp > /dev/null || wget https://github.com/appleboy/drone-scp/releases/download/v{}/drone-scp-{}-{}-{}",drone_scp_version, drone_scp_version, os, arch),
])?
.with_exec(vec![
"sh",
"-c",
&format!("type drone-scp > /dev/null || chmod a+x drone-scp-*")])?
&format!("type drone-scp > /dev/null || chmod a+x drone-scp-{}-{}-{}",
drone_scp_version, os, arch
)])?
.with_exec(vec![
"sh",
"-c",
"type drone-scp > /dev/null || mv drone-scp-* $HOME/.local/bin/drone-scp",
&format!("type drone-scp > /dev/null || mv drone-scp-{}-{}-{} {}/.local/bin/drone-scp", drone_scp_version, os, arch, home),
])?
.stdout()?;
Ok(stdout)
Expand Down

0 comments on commit e285d71

Please sign in to comment.