@@ -53,12 +53,9 @@ type LibraryInstallPlan struct {
53
53
// install path, where the library should be installed and the possible library that is already
54
54
// installed on the same folder and it's going to be replaced by the new one.
55
55
func (lm * LibrariesManager ) InstallPrerequisiteCheck (name string , version * semver.Version , installLocation libraries.LibraryLocation ) (* LibraryInstallPlan , error ) {
56
- installDir := lm .getLibrariesDir (installLocation )
57
- if installDir == nil {
58
- if installLocation == libraries .User {
59
- return nil , fmt .Errorf (tr ("User directory not set" ))
60
- }
61
- return nil , fmt .Errorf (tr ("Builtin libraries directory not set" ))
56
+ installDir , err := lm .getLibrariesDir (installLocation )
57
+ if err != nil {
58
+ return nil , err
62
59
}
63
60
64
61
libs := lm .FindByReference (& librariesindex.Reference {Name : name }, installLocation )
@@ -130,11 +127,6 @@ func (lm *LibrariesManager) Uninstall(lib *libraries.Library) error {
130
127
131
128
// InstallZipLib installs a Zip library on the specified path.
132
129
func (lm * LibrariesManager ) InstallZipLib (ctx context.Context , archivePath * paths.Path , overwrite bool ) error {
133
- installDir := lm .getLibrariesDir (libraries .User )
134
- if installDir == nil {
135
- return fmt .Errorf (tr ("User directory not set" ))
136
- }
137
-
138
130
// Clone library in a temporary directory
139
131
tmpDir , err := paths .MkTempDir ("" , "" )
140
132
if err != nil {
@@ -207,11 +199,6 @@ func (lm *LibrariesManager) InstallZipLib(ctx context.Context, archivePath *path
207
199
208
200
// InstallGitLib installs a library hosted on a git repository on the specified path.
209
201
func (lm * LibrariesManager ) InstallGitLib (gitURL string , overwrite bool ) error {
210
- installDir := lm .getLibrariesDir (libraries .User )
211
- if installDir == nil {
212
- return fmt .Errorf (tr ("User directory not set" ))
213
- }
214
-
215
202
gitLibraryName , ref , err := parseGitURL (gitURL )
216
203
if err != nil {
217
204
return err
0 commit comments