(modules []string)
| 96 | } |
| 97 | |
| 98 | func installModules(modules []string) { |
| 99 | pkg, _ := models.LoadPackage(true) |
| 100 | dependencies := pkg.Dependencies.(map[string]interface{}) |
| 101 | encountered := 0 |
| 102 | for _, newPackage := range modules { |
| 103 | for installed := range dependencies { |
| 104 | if strings.Contains(installed, newPackage) { |
| 105 | encountered++ |
| 106 | } |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | nextUpdate := env.GlobalConfiguration.LastInternalUpdate. |
| 111 | AddDate(0, 0, env.GlobalConfiguration.PurgeTime) |
| 112 | |
| 113 | if encountered == len(modules) && time.Now().Before(nextUpdate) { |
| 114 | return |
| 115 | } |
| 116 | |
| 117 | env.GlobalConfiguration.LastInternalUpdate = time.Now() |
| 118 | env.GlobalConfiguration.SaveConfiguration() |
| 119 | |
| 120 | installer.GlobalInstall(modules, pkg, false, false) |
| 121 | moveBptIdentifier() |
| 122 | } |
| 123 | |
| 124 | func moveBptIdentifier() { |
| 125 | var OutExeCompilation = filepath.Join(env.GetGlobalBinPath(), consts.BplIdentifierName) |
no test coverage detected