private static async GetJsonsFromUtils()

in src/jsonLoader.ts [218:257]


    private static async GetJsonsFromUtils(repo: string, type: SourceType): Promise<IndexedFoldersSet> {
        let owner: string = JsonLoader.microsoft;
        let ref: string = "heads/master";

        let folder: string = "dist";
        let fileName: string = "localizationUtils.tar.gz";
        let filePath: string = folder + "/" + fileName;

        return GithubApiCreator.CreateGithubApi().repos.getArchiveLink({
            archive_format: "tarball",
            owner: owner,
            ref: ref,
            repo: repo
        })
        .then((data) => {
            return JsonLoader.GetJsonByUrl(data.meta.location).promise();
        })
        .then((targz) => {
            return LoaderUtils.ExtractTargz(targz, filePath, folder);
        })
        .then(() => {
            let foldersSet: IndexedFoldersSet = {}; 

            let locUtils: string = fs.readdirSync("dist")
                .filter(directory => fs.lstatSync(Path.join("dist", directory)).isDirectory() && directory.indexOf("localizationutils") > 0)[0];

            let rootFolder = Path.join("dist", locUtils);
            
            let jsonPaths: IndexedFoldersSet = new IndexedFoldersSet();

            for (let visualName in data) {
                if (data[visualName]) {
                    let visualFolderPath: string = Path.join(rootFolder, visualName);
                    foldersSet[visualName] = LoaderUtils.GetIndexedObjects(visualFolderPath, true);
                }
            }

            return foldersSet;
        });
    }