-
-
Notifications
You must be signed in to change notification settings - Fork 320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using outputHandler to monitor progress events #529
Comments
Until v3 is released, you can use outputHandler to receive updates as |
well,Is there any way to monitor the download progress |
That would depend on which command you are running through In order to suggest something more specific, please include your code and any use of |
Code:
Question: |
@steveukx The above method is that I simulate the progress. I hope to use a method to execute the download all the time |
@steveukx hi,Is there any solution |
The
|
ok. thanks i am try |
I think git -js can combine with the progress module to make a progress bar |
@steveukx v3 edition Is there any way to monitor the download progress? |
such as:
|
Hi, you can now configure If you have any problems using the new api, please do open another issue. |
@steveukx |
Hi, in order to look into this for you please also include the code you are using to respond to progress events. Thanks |
|
Your progress handler is terminating the node process on the first 100% complete A more robust solution would be: const SimpleGit = require('simple-git')
const ora = require('ora')
const process = require("process")
const spinner = ora('开始下载').start();
const progress = ({ stage, progress }) => {
let proText = `当前下载进度: ${stage} ${progress}%`
spinner.text = proText
if (progress === 100) {
spinner.text = proText + ' 下载完成'
}
}
module.exports.clone = async (repo) => {
const git = SimpleGit({ progress: progress })
await git.clone(repo);
process.exit();
} |
Wow, thank you for your advice |
No problem, please do open a new issue if you have any further issues |
Can I add a callback method when I download so that I can add the download progress
The text was updated successfully, but these errors were encountered: