non important commit
This commit is contained in:
parent
69cac30da8
commit
2800c4342d
1 changed files with 2 additions and 5 deletions
|
|
@ -42,27 +42,24 @@
|
|||
}
|
||||
|
||||
|
||||
def flake [command?: string] {
|
||||
def flake [...command: string] {
|
||||
let git_result = do { git rev-parse --show-toplevel } | complete
|
||||
if $git_result.exit_code != 0 {
|
||||
print "You are not in a git repository"
|
||||
return
|
||||
}
|
||||
|
||||
let root = $git_result.stdout | str trim
|
||||
let flake_path = $root | path join "flake.nix"
|
||||
if not ($flake_path | path exists) {
|
||||
print "There is no flake in this repository"
|
||||
return
|
||||
}
|
||||
|
||||
let dev_check = do { nix develop $root --command true } | complete
|
||||
|
||||
if $dev_check.exit_code == 0 {
|
||||
if ($command | is-empty) {
|
||||
nix develop $root
|
||||
} else {
|
||||
nix develop $root --command $command
|
||||
nix develop $root --command ...$command
|
||||
}
|
||||
} else {
|
||||
print "This flake doesn't have a default shell"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue