github.com/ActiveState/cli@v0.0.0-20240508170324-6801f60cd051/cmd/state-exec/exitcode.go (about)

     1  package main
     2  
     3  import (
     4  	"fmt"
     5  	"os"
     6  	"strconv"
     7  
     8  	"github.com/ActiveState/cli/internal/svcctl/svcmsg"
     9  )
    10  
    11  func newExitCodeMessage(exitCode int) (*svcmsg.ExitCode, error) {
    12  	execPath, err := os.Executable()
    13  	if err != nil {
    14  		return nil, fmt.Errorf("cannot get executable info: %w", err)
    15  	}
    16  	return &svcmsg.ExitCode{execPath, strconv.Itoa(exitCode)}, nil
    17  }