chore: refactiring the on progress callback so we can see more ata and failures

This commit is contained in:
blam
2020-12-01 20:04:36 +01:00
parent 572b618259
commit f393f300e5
@@ -67,22 +67,22 @@ export class GithubPreparer implements PreparerBase {
dir: checkoutLocation,
singleBranch: true,
depth: 1,
onProgress: event => {
const total = event.total
? `${event.loaded / event.total}%`
: event.loaded;
opts.logger.info({ status: event.phase, total });
},
headers: {
'user-agent': 'git/@isomorphic-git',
},
onAuth: () => ({ username: token, password: 'x-oauth-basic' }),
});
} catch (ex) {
opts.logger.error(
`Failed checking out repository:${repositoryCheckoutUrl}`,
`Failed checking out repository: ${repositoryCheckoutUrl}`,
);
opts.logger.error(ex.message);
console.warn(ex.data.url);
console.warn({
fs: require('fs'),
http,
url: repositoryCheckoutUrl,
dir: templateDirectory,
depth: 1,
onAuth: () => ({ username: token, password: 'x-oauth-basic' }),
});
throw ex;
}