async function downloadFile()

in code/index.js [94:118]


async function downloadFile(repoConfig, proxy) {
    console.log('info', '>>> downloadFile()');
    console.log(`proxy: ${JSON.stringify(proxy)}`);

    const params = {
        proxy,
        method: 'get',
        baseURL: repoConfig.serverUrl,
        url: `/rest/api/latest/projects/${repoConfig.projectName}/repos/${repoConfig.repoName}/archive?at=refs/heads/${repoConfig.branch}&format=zip`,
        responseType: 'stream',
        headers: {
            Authorization: `Bearer ${repoConfig.token}`
        }
    };

    try {
        const resp = await axios.request(params);
        console.log('info', '<<< downloadFile()');
        return resp.data;
    }
    catch (err) {
        console.log('error', err);
        throw new Error(err);
    }
}