Skip to content

Commit

Permalink
read KAMAL_VERSION if defined
Browse files Browse the repository at this point in the history
  • Loading branch information
tsirysndr committed Sep 26, 2024
1 parent c33d628 commit bff5f14
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
10 changes: 3 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
[package]
authors = [
"Tsiry Sandratraina <[email protected]>",
]
authors = ["Tsiry Sandratraina <[email protected]>"]
description = "Deploy web apps anywhere"
edition = "2021"
license = "MIT"
name = "kamal"
version = "0.1.0"
version = "0.1.1"

[lib]
crate-type = [
"cdylib",
]
crate-type = ["cdylib"]

[dependencies]
anyhow = "1.0.82"
Expand Down
12 changes: 4 additions & 8 deletions fluentci.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
[package]
authors = [
"Tsiry Sandratraina <[email protected]>"
]
authors = ["Tsiry Sandratraina <[email protected]>"]
description = "Deploy web apps anywhere"
license = "MIT"
name = "kamal"
version = "0.1.0"
keywords = [
"kamal",
"deploy"
]
version = "0.1.1"
keywords = ["kamal", "deploy"]

8 changes: 7 additions & 1 deletion src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,19 @@ pub fn setup_flox() -> Result<(), Error> {
pub fn setup() -> Result<(), Error> {
let home = dag().get_env("HOME")?;
let path = dag().get_env("PATH")?;
let version = dag().get_env("KAMAL_VERSION")?;
let version = if version.is_empty() {
"".to_string()
} else {
format!("-v {}", version)
};

setup_flox()?;
dag()
.pipeline("setup kamal")?
.flox()?
.with_exec(vec!["flox install ruby"])?
.with_exec(vec!["gem install kamal"])?
.with_exec(vec![&format!("gem install kamal {}", version)])?
.with_exec(vec!["[ -d $HOME/.local/bin ] || mkdir -p $HOME/.local/bin"])?
.with_exec(vec!["ln -s `flox activate -- gem environment gemhome`/bin/kamal $HOME/.local/bin/kamal || true"])?
.with_exec(vec!["PATH=$HOME/.local/bin:$PATH", "type", "kamal"])?
Expand Down

0 comments on commit bff5f14

Please sign in to comment.