File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2525 - name : Set up Go
2626 uses : actions/setup-go@v6
2727 with :
28- go-version : ' 1.21 '
28+ go-version : ' 1.22 '
2929 cache : true
3030
3131 - name : Download dependencies
5656 - name : Set up Go
5757 uses : actions/setup-go@v6
5858 with :
59- go-version : ' 1.21 '
59+ go-version : ' 1.22 '
6060 cache : true
6161
6262 - name : Run golangci-lint
7979 - name : Set up Go
8080 uses : actions/setup-go@v6
8181 with :
82- go-version : ' 1.21 '
82+ go-version : ' 1.22 '
8383 cache : true
8484
8585 - name : Build
Original file line number Diff line number Diff line change 2929 - name : Set up Go
3030 uses : actions/setup-go@v6
3131 with :
32- go-version : ' 1.21 '
32+ go-version : ' 1.22 '
3333 cache : true
3434
3535 - name : Get version
Original file line number Diff line number Diff line change 1+ package config
2+
3+ import (
4+ "os"
5+ "path/filepath"
6+ )
7+
8+ // Config holds the configuration for the SDK manager
9+ type Config struct {
10+ ConfigDir string
11+ CacheDir string
12+ InstallDir string
13+ RegistryURL string
14+ }
15+
16+ // New creates a new configuration with default values
17+ func New () (* Config , error ) {
18+ homeDir , err := os .UserHomeDir ()
19+ if err != nil {
20+ return nil , err
21+ }
22+
23+ configDir := filepath .Join (homeDir , ".unosdk" )
24+ cacheDir := filepath .Join (configDir , "cache" )
25+ installDir := filepath .Join (configDir , "sdks" )
26+
27+ return & Config {
28+ ConfigDir : configDir ,
29+ CacheDir : cacheDir ,
30+ InstallDir : installDir ,
31+ RegistryURL : DefaultRegistryURL ,
32+ }, nil
33+ }
34+
35+ // EnsureDirectories creates necessary directories if they don't exist
36+ func (c * Config ) EnsureDirectories () error {
37+ dirs := []string {
38+ c .ConfigDir ,
39+ c .CacheDir ,
40+ c .InstallDir ,
41+ }
42+
43+ for _ , dir := range dirs {
44+ if err := os .MkdirAll (dir , 0755 ); err != nil {
45+ return err
46+ }
47+ }
48+
49+ return nil
50+ }
Original file line number Diff line number Diff line change 1+ package config
2+
3+ const (
4+ // DefaultRegistryURL is the default registry URL for SDK metadata
5+ DefaultRegistryURL = "https://api.github.com/repos/javaquery/unosdk-registry"
6+ )
You can’t perform that action at this time.
0 commit comments