@@ -53,12 +53,9 @@ type LibraryInstallPlan struct {
5353// install path, where the library should be installed and the possible library that is already 
5454// installed on the same folder and it's going to be replaced by the new one. 
5555func  (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 
6259	}
6360
6461	libs  :=  lm .FindByReference (& librariesindex.Reference {Name : name }, installLocation )
@@ -130,11 +127,6 @@ func (lm *LibrariesManager) Uninstall(lib *libraries.Library) error {
130127
131128// InstallZipLib installs a Zip library on the specified path. 
132129func  (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- 
138130	// Clone library in a temporary directory 
139131	tmpDir , err  :=  paths .MkTempDir ("" , "" )
140132	if  err  !=  nil  {
@@ -207,11 +199,6 @@ func (lm *LibrariesManager) InstallZipLib(ctx context.Context, archivePath *path
207199
208200// InstallGitLib installs a library hosted on a git repository on the specified path. 
209201func  (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- 
215202	gitLibraryName , ref , err  :=  parseGitURL (gitURL )
216203	if  err  !=  nil  {
217204		return  err 
0 commit comments