public static string install_LibraryFromZip(this TM_FileStorage tmFileStorage, string pathToGitHubZipBall, string libraryName) { UserGroup.Admin.assert(); try { var tmXmlDatabase = tmFileStorage.tmXmlDatabase(); if (tmFileStorage.isNull() || tmXmlDatabase.isNull()) { return(null); } var tmLibrary = tmXmlDatabase.tmLibrary(libraryName); if (tmLibrary.notNull()) { "[Install_LibraryFromZip] Skyping library {0} because it already existed".debug(libraryName); return(tmFileStorage.xmlDB_Path_Library_RootFolder(tmLibrary)); } var tmLibraries_Before = tmXmlDatabase.tmLibraries(); var result = tmFileStorage.xmlDB_Libraries_ImportFromZip(pathToGitHubZipBall, ""); var tmLibraries_After = tmXmlDatabase.tmLibraries(); var installedLibrary = tmXmlDatabase.tmLibrary(libraryName); Assert.IsTrue(result, "xmlDB_Libraries_ImportFromZip"); Assert.IsNotEmpty(tmLibraries_After, "Libraries should be there after install"); Assert.AreNotEqual(tmLibraries_After.size(), tmLibraries_Before.size(), "Libraries size should be different before and after"); Assert.IsNotNull(installedLibrary, "Could not find installed library: {0}".format(libraryName)); Assert.AreEqual(installedLibrary.Caption, libraryName, "After install library names didn't match"); return(tmFileStorage.xmlDB_Path_Library_RootFolder(installedLibrary)); } finally { UserGroup.None.assert(); } }