1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-19 05:19:39 +02:00

chore(build-system): make assets default relative, serve assets from assets/public (#1309)

This commit is contained in:
1138-4EB 2017-10-26 11:17:45 +02:00 committed by Anthony Lapenna
parent c4e75fc858
commit 34d40e4876
6 changed files with 23 additions and 31 deletions

View file

@ -7,6 +7,7 @@ import (
"github.com/portainer/portainer"
"os"
"path/filepath"
"strings"
"gopkg.in/alecthomas/kingpin.v2"
@ -54,6 +55,15 @@ func (*Service) ParseFlags(version string) (*portainer.CLIFlags, error) {
}
kingpin.Parse()
if !filepath.IsAbs(*flags.Assets) {
ex, err := os.Executable()
if err != nil {
panic(err)
}
*flags.Assets = filepath.Join(filepath.Dir(ex), *flags.Assets)
}
return flags, nil
}