mirror of
https://github.com/F1bonacc1/process-compose.git
synced 2024-09-11 11:35:26 +03:00
Support nil user
This commit is contained in:
parent
eaa05812bc
commit
a149977b44
2
Makefile
2
Makefile
@ -25,7 +25,7 @@ swag:
|
|||||||
~/go/bin/swag init --dir src --output src/docs --parseDependency --parseInternal --parseDepth 1
|
~/go/bin/swag init --dir src --output src/docs --parseDependency --parseInternal --parseDepth 1
|
||||||
|
|
||||||
build:
|
build:
|
||||||
go build -o bin/${NAME}${EXT} ${LD_FLAGS} ./src
|
CGO_ENABLED=0 go build -o bin/${NAME}${EXT} ${LD_FLAGS} ./src
|
||||||
|
|
||||||
build-nix:
|
build-nix:
|
||||||
nix build .
|
nix build .
|
||||||
|
9
issues/issue_84/process-compose.yaml
Normal file
9
issues/issue_84/process-compose.yaml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
version: "0.5"
|
||||||
|
log_level: debug
|
||||||
|
log_length: 300
|
||||||
|
|
||||||
|
processes:
|
||||||
|
clientA:
|
||||||
|
command: "sleep 5 && touch ready"
|
||||||
|
|
||||||
|
|
@ -34,7 +34,11 @@ func GetLogFilePath() string {
|
|||||||
if found {
|
if found {
|
||||||
return val
|
return val
|
||||||
}
|
}
|
||||||
return filepath.Join(os.TempDir(), fmt.Sprintf("process-compose-%s%s.log", mustUser(), mode()))
|
userName := getUser()
|
||||||
|
if len(userName) != 0 {
|
||||||
|
userName = "-" + userName
|
||||||
|
}
|
||||||
|
return filepath.Join(os.TempDir(), fmt.Sprintf("process-compose%s%s.log", userName, mode()))
|
||||||
}
|
}
|
||||||
|
|
||||||
func procCompHome() string {
|
func procCompHome() string {
|
||||||
@ -58,10 +62,11 @@ func GetShortCutsPath() string {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func mustUser() string {
|
func getUser() string {
|
||||||
usr, err := user.Current()
|
usr, err := user.Current()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal().Err(err).Msg("Failed to retrieve user info")
|
log.Warn().Err(err).Msg("Failed to retrieve user info.")
|
||||||
|
return ""
|
||||||
}
|
}
|
||||||
return usr.Username
|
return usr.Username
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user