mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-21 17:21:09 +01:00
25 lines
477 B
Go
25 lines
477 B
Go
package fs
|
|
|
|
import (
|
|
"github.com/apex/log"
|
|
"github.com/mitchellh/go-homedir"
|
|
"github.com/spf13/viper"
|
|
"path/filepath"
|
|
)
|
|
|
|
func init() {
|
|
rootDir, err := homedir.Dir()
|
|
if err != nil {
|
|
log.Warnf("cannot find home directory: %v", err)
|
|
return
|
|
}
|
|
DefaultWorkspacePath = filepath.Join(rootDir, "crawlab_workspace")
|
|
|
|
workspacePath := viper.GetString("workspace")
|
|
if workspacePath == "" {
|
|
viper.Set("workspace", DefaultWorkspacePath)
|
|
}
|
|
}
|
|
|
|
var DefaultWorkspacePath string
|