Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specific Env Vars and Edit Command #142

Closed
wants to merge 7 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: make env var required for edit command
Burtannia committed Aug 8, 2024
commit 1754c85421b45c2d69f9a4c44cdd642031b61d46
4 changes: 1 addition & 3 deletions src/home.rs
Original file line number Diff line number Diff line change
@@ -37,9 +37,7 @@ impl NHRunnable for HomeArgs {

impl HomeEditArgs {
fn edit(&self) -> Result<()> {
let flakeref = self.flakeref.clone().expect("NH_HOME_FLAKE not set");

commands::edit(flakeref)
commands::edit(self.flakeref.clone())
}
}

4 changes: 2 additions & 2 deletions src/interface.rs
Original file line number Diff line number Diff line change
@@ -97,7 +97,7 @@ pub enum OsRebuildType {
#[derive(Debug, Args)]
pub struct OsEditArgs {
#[arg(env = "NH_OS_FLAKE", value_hint = clap::ValueHint::DirPath)]
pub flakeref: Option<FlakeRef>,
pub flakeref: FlakeRef,
}

#[derive(Debug, Args)]
@@ -286,7 +286,7 @@ pub struct HomeRebuildArgs {
#[derive(Debug, Args)]
pub struct HomeEditArgs {
#[arg(env = "NH_HOME_FLAKE", value_hint = clap::ValueHint::DirPath)]
pub flakeref: Option<FlakeRef>,
pub flakeref: FlakeRef,
}

#[derive(Debug, Parser)]
3 changes: 1 addition & 2 deletions src/nixos.rs
Original file line number Diff line number Diff line change
@@ -28,8 +28,7 @@ impl NHRunnable for interface::OsArgs {

impl OsEditArgs {
fn edit(&self) -> Result<()> {
let flakeref = self.flakeref.clone().expect("NH_OS_FLAKE not set");
commands::edit(flakeref)
commands::edit(self.flakeref.clone())
}
}