Skip to content
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

Ask to confirm the export when the tarball already exists in the directory #3 #134

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vinod-kha
Copy link

Dear @benja-M-1

I hope this message finds you well. I wanted to reach out and let you know that I've recently made some contributions to Docker/Volumes-backup on GitHub. I've put in my best effort to improve volume, including

Confirmation for Overwriting:

  • It checks if the target file specified by path and fileName already exists.
  • If the file exists, it prompts the user to choose an action:
    - Overwrite the existing file (O)
    - Keep both files by renaming the new file (K)
    - Cancel the export (C)
  • Depending on the user's choice, it modifies the fileName accordingly.

Github Project Repo -- https://github.com/docker/volumes-backup-extension.git

Some piece of code added in --
https://github.com/docker/volumes-backup-extension/blob/main/vm/internal/handler/export.go
line -- 43-67

I would greatly appreciate it if you could take a moment to review my changes and provide any feedback or suggestions for improvement. Your expertise and guidance would be invaluable to me, and I'm eager to learn and contribute further to the project.

Thank you for considering my contributions. I look forward to hearing from you soon.

Best regards,
Vinod

@vinod-kha vinod-kha requested a review from a team as a code owner May 10, 2024 16:07
Comment on lines +46 to +53
fmt.Println("A file with the same name already exists in the target directory.")
fmt.Println("Do you want to:")
fmt.Println("1. Overwrite the existing file (O)")
fmt.Println("2. Keep both files (K)")
fmt.Println("3. Cancel the export (C)")

var userInput string
fmt.Scanln(&userInput)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: I am not sure to understand how this can work. How the user could do anything at this point? Since this is in a handler it is not interactive, the handler treats an HTTP request and return an HTTP response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants