non important commit

This commit is contained in:
maxstrb 2025-10-04 21:17:50 +02:00
parent 69cac30da8
commit 2800c4342d

View file

@ -42,27 +42,24 @@
} }
def flake [command?: string] { def flake [...command: string] {
let git_result = do { git rev-parse --show-toplevel } | complete let git_result = do { git rev-parse --show-toplevel } | complete
if $git_result.exit_code != 0 { if $git_result.exit_code != 0 {
print "You are not in a git repository" print "You are not in a git repository"
return return
} }
let root = $git_result.stdout | str trim let root = $git_result.stdout | str trim
let flake_path = $root | path join "flake.nix" let flake_path = $root | path join "flake.nix"
if not ($flake_path | path exists) { if not ($flake_path | path exists) {
print "There is no flake in this repository" print "There is no flake in this repository"
return return
} }
let dev_check = do { nix develop $root --command true } | complete let dev_check = do { nix develop $root --command true } | complete
if $dev_check.exit_code == 0 { if $dev_check.exit_code == 0 {
if ($command | is-empty) { if ($command | is-empty) {
nix develop $root nix develop $root
} else { } else {
nix develop $root --command $command nix develop $root --command ...$command
} }
} else { } else {
print "This flake doesn't have a default shell" print "This flake doesn't have a default shell"