Skip to content

Commit 94add6b

Browse files
committed
refactor: use constant for menu command name
1 parent 9c87676 commit 94add6b

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

modules/devshell.nix

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ let
1212
# environment.
1313
strOrPackage = import ../nix/strOrPackage.nix { inherit lib pkgs; };
1414

15+
inherit (import ../nix/commands/devshellMenu.nix { inherit pkgs; }) devshellMenuCommandName;
16+
1517
# Use this to define a flake app for the environment.
1618
mkFlakeApp = bin: {
1719
type = "app";
@@ -255,7 +257,7 @@ in
255257
type = types.str;
256258
default = ''
257259
{202}🔨 Welcome to ${cfg.name}{reset}
258-
$(type -p menu &>/dev/null && menu)
260+
$(type -p ${devshellMenuCommandName} &>/dev/null && ${devshellMenuCommandName})
259261
'';
260262
apply = replaceStrings
261263
(map (key: "{${key}}") (attrNames ansi))

tests/core/commands.nix

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{ pkgs, devshell, runTest }:
2+
let inherit (import ../../nix/commands/devshellMenu.nix { inherit pkgs; }) devshellMenuCommandName; in
23
{
34
# Basic devshell usage
45
commands-1 =
@@ -33,7 +34,7 @@
3334
# Load the devshell
3435
source ${shell}/env.bash
3536
36-
menu
37+
${devshellMenuCommandName}
3738
3839
# Checks that all the commands are available
3940
type -p bash-script

0 commit comments

Comments
 (0)