diff options
Diffstat (limited to 'lib/xdsconfig')
-rw-r--r-- | lib/xdsconfig/config.go | 4 | ||||
-rw-r--r-- | lib/xdsconfig/fileconfig.go | 18 |
2 files changed, 11 insertions, 11 deletions
diff --git a/lib/xdsconfig/config.go b/lib/xdsconfig/config.go index 59cf394..74ce21e 100644 --- a/lib/xdsconfig/config.go +++ b/lib/xdsconfig/config.go @@ -55,7 +55,7 @@ const ( DefaultPort = "8000" DefaultShareDir = "${HOME}/.xds/server/projects" DefaultSTHomeDir = "${HOME}/.xds/server/syncthing-config" - DefaultSdkRootDir = "/xdt/sdk" + DefaultSdkScriptsDir = "${EXEPATH}/scripts/sdks" ) // Init loads the configuration on start-up @@ -97,7 +97,7 @@ func Init(cliCtx *cli.Context, log *logrus.Logger) (*Config, error) { FileConf: FileConfig{ WebAppDir: "webapp/dist", ShareRootDir: dfltShareDir, - SdkRootDir: DefaultSdkRootDir, + SdkScriptsDir: DefaultSdkScriptsDir, HTTPPort: DefaultPort, SThgConf: &SyncThingConf{Home: dfltSTHomeDir}, LogsDir: "", diff --git a/lib/xdsconfig/fileconfig.go b/lib/xdsconfig/fileconfig.go index 8e77de7..bf8aa25 100644 --- a/lib/xdsconfig/fileconfig.go +++ b/lib/xdsconfig/fileconfig.go @@ -51,12 +51,12 @@ type SyncThingConf struct { // FileConfig is the JSON structure of xds-server config file (server-config.json) type FileConfig struct { - WebAppDir string `json:"webAppDir"` - ShareRootDir string `json:"shareRootDir"` - SdkRootDir string `json:"sdkRootDir"` - HTTPPort string `json:"httpPort"` - SThgConf *SyncThingConf `json:"syncthing"` - LogsDir string `json:"logsDir"` + WebAppDir string `json:"webAppDir"` + ShareRootDir string `json:"shareRootDir"` + SdkScriptsDir string `json:"sdkScriptsDir"` + HTTPPort string `json:"httpPort"` + SThgConf *SyncThingConf `json:"syncthing"` + LogsDir string `json:"logsDir"` } // readGlobalConfig reads configuration from a config file. @@ -117,7 +117,7 @@ func readGlobalConfig(c *Config, confFile string) error { vars := []*string{ &fCfg.WebAppDir, &fCfg.ShareRootDir, - &fCfg.SdkRootDir, + &fCfg.SdkScriptsDir, &fCfg.LogsDir} if fCfg.SThgConf != nil { vars = append(vars, &fCfg.SThgConf.Home, &fCfg.SThgConf.BinDir) @@ -136,8 +136,8 @@ func readGlobalConfig(c *Config, confFile string) error { if fCfg.ShareRootDir == "" { fCfg.ShareRootDir = c.FileConf.ShareRootDir } - if fCfg.SdkRootDir == "" { - fCfg.SdkRootDir = c.FileConf.SdkRootDir + if fCfg.SdkScriptsDir == "" { + fCfg.SdkScriptsDir = c.FileConf.SdkScriptsDir } if fCfg.HTTPPort == "" { fCfg.HTTPPort = c.FileConf.HTTPPort |