Skip to content

Commit

Permalink
generate: tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
domenkozar committed Dec 26, 2024
1 parent 806048f commit ab9c9ea
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
4 changes: 2 additions & 2 deletions devenv/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ pub enum Commands {
#[arg(num_args=0.., trailing_var_arg = true)]
description: Vec<String>,

#[clap(long, default_value = "https://generate.devenv.sh")]
#[clap(long, default_value = "https://devenv.new")]
host: String,

#[arg(
Expand All @@ -203,7 +203,7 @@ pub enum Commands {

// https://consoledonottrack.com/
#[clap(long, env = "DO_NOT_TRACK", action = clap::ArgAction::SetTrue)]
disable_telemetry: bool,
disable_analytics: bool,
},

#[command(about = "Activate the developer environment. https://devenv.sh/basics/")]
Expand Down
10 changes: 2 additions & 8 deletions devenv/src/devenv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,18 +191,12 @@ impl Devenv {
description: Option<String>,
host: &str,
exclude: Vec<PathBuf>,
disable_telemetry: bool,
disable_analytics: bool,
) -> Result<()> {
// TODO: get nixpkgs revision and devenv revision
let nixpkgs_rev = "";
let devenv_rev = "";

let client = reqwest::Client::new();
let mut request = client
.post(host)
.query(&[("disable_telemetry", disable_telemetry)])
.query(&[("nixpkgs", nixpkgs_rev)])
.query(&[("devenv", devenv_rev)])
.query(&[("disable_analytics", disable_analytics)])
.header(reqwest::header::USER_AGENT, crate_version!());

let (asyncwriter, asyncreader) = tokio::io::duplex(256 * 1024);
Expand Down
4 changes: 2 additions & 2 deletions devenv/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ async fn main() -> Result<()> {
description,
host,
exclude,
disable_telemetry,
disable_analytics,
} => {
devenv
.generate(
Expand All @@ -144,7 +144,7 @@ async fn main() -> Result<()> {
},
&host,
exclude,
disable_telemetry,
disable_analytics,
)
.await
}
Expand Down

0 comments on commit ab9c9ea

Please sign in to comment.