MCPcopy Index your code
hub / github.com/jetify-com/devbox / refreshAlias

Method refreshAlias

internal/devbox/refresh.go:55–76  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

53}
54
55func (d *Devbox) refreshAlias() string {
56 if isFishShell() {
57 return fmt.Sprintf(
58 `if not type %[1]s >/dev/null 2>&1
59 export %[2]s='%[3]s'
60 alias %[1]s='%[3]s'
61end`,
62 d.refreshAliasName(),
63 d.refreshAliasEnvVar(),
64 d.refreshCmd(),
65 )
66 }
67 return fmt.Sprintf(
68 `if ! type %[1]s >/dev/null 2>&1; then
69 export %[2]s='%[3]s'
70 alias %[1]s='%[3]s'
71fi`,
72 d.refreshAliasName(),
73 d.refreshAliasEnvVar(),
74 d.refreshCmd(),
75 )
76}
77
78func (d *Devbox) refreshAliasForShell(format string) string {
79 // For nushell format, provide instructions as a comment since aliases with pipes are complex

Callers 1

refreshAliasForShellMethod · 0.95

Calls 4

refreshAliasNameMethod · 0.95
refreshAliasEnvVarMethod · 0.95
refreshCmdMethod · 0.95
isFishShellFunction · 0.85

Tested by

no test coverage detected