mirror of
https://github.com/taigrr/wails.git
synced 2026-04-13 18:38:11 -07:00
use userid=1000 if user.Current() is not an integer
This commit is contained in:
committed by
Lea Anthony
parent
2ab8fc37ab
commit
76edc7976e
@@ -8,6 +8,7 @@ import (
|
||||
"os/user"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@@ -173,9 +174,12 @@ func BuildApplication(binaryName string, forceRebuild bool, buildMode string, pa
|
||||
|
||||
buildCommand := slicer.String()
|
||||
if projectOptions.CrossCompile {
|
||||
user, err := user.Current()
|
||||
if err != nil {
|
||||
return err
|
||||
userid := 1000
|
||||
user, _ := user.Current()
|
||||
if i, err := strconv.Atoi(user.Uid); err == nil {
|
||||
userid = i
|
||||
} else {
|
||||
userid = 1000
|
||||
}
|
||||
for _, arg := range []string{
|
||||
"docker",
|
||||
@@ -183,7 +187,7 @@ func BuildApplication(binaryName string, forceRebuild bool, buildMode string, pa
|
||||
"--rm",
|
||||
"-v", fmt.Sprintf("%s/build:/build", fs.Cwd()),
|
||||
"-v", fmt.Sprintf("%s:/source", fs.Cwd()),
|
||||
"-e", fmt.Sprintf("LOCAL_USER_ID=%v", user.Uid),
|
||||
"-e", fmt.Sprintf("LOCAL_USER_ID=%v", userid),
|
||||
"-e", fmt.Sprintf("FLAG_LDFLAGS=%s", ldflags),
|
||||
"-e", "FLAG_V=false",
|
||||
"-e", "FLAG_X=false",
|
||||
|
||||
Reference in New Issue
Block a user