Skip to content

Commit

Permalink
Add $APPNAME to expansion variables
Browse files Browse the repository at this point in the history
  • Loading branch information
kenshaw committed Dec 7, 2024
1 parent 14e9897 commit 1dc9b16
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ox.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ func (ctx *Context) Run(parent context.Context) error {

// Expand expands s.
//
// $APPNAME - the root command's name
// $HOME - the current user's home directory
// $USER - the current user's user name
// $CONFIG - the current user's config directory
Expand Down Expand Up @@ -294,6 +295,8 @@ func (ctx *Context) Expand(v any) (string, error) {
}
return filepath.Join(dir, ctx.Root.Name), nil
}
case "$APPNAME":
return ctx.Root.Name, nil
case "$NUMCPU":
return strconv.Itoa(runtime.NumCPU()), nil
case "$ARCH":
Expand Down

0 comments on commit 1dc9b16

Please sign in to comment.