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

Update cache command to handle directories #360

Merged
merged 4 commits into from
Apr 25, 2023

Conversation

mdanish-kh
Copy link
Contributor

@mdanish-kh mdanish-kh commented Apr 13, 2023

Motivation

The implementation of zip installers meant that winget-create now extracts the zip archives to
%LOCALAPPDATA%\Temp\wingetcreate. The extracted directories are not shown in wingetcreate cache --list and not removed by wingetcreate cache --clean. This PR aims to fix the behavior by listing and removing the extracted folders in the respective wingetcreate cache commands.

Description

  • Create a new localized message DirectoriesFound_Message to show in cache --list
  • The directory names are appended by / or \ (depending on the OS)
  • When deleting the directories, I used the same message for deleting installers i.e., DeletingInstaller_Message as I didn't feel the need to create a new string for it. Renamed the existing resource string from DeletingInstaller_Message -> DeletingItem_Message to be more generic to cater for deletion of directories as well
  • Recursively delete the directories in cache --clean

Microsoft Reviewers: Open in CodeFlow

@mdanish-kh mdanish-kh requested a review from a team as a code owner April 13, 2023 14:53
@mdanish-kh mdanish-kh requested review from yao-msft and ryfu-msft and removed request for a team April 13, 2023 14:53
@ryfu-msft
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ryfu-msft
Copy link
Contributor

Ah I should have mentioned this before, you only need to edit the file src/WingetCreateCLI/Properties/Resources.resx. All of the other localized resx files will need to go through internal review and they will generate those files for us with the new changes. Please revert everything in Localization/Resources folder.

@ryfu-msft
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

@ryfu-msft ryfu-msft left a comment

Choose a reason for hiding this comment

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

:shipit:

@ryfu-msft ryfu-msft merged commit c415f84 into microsoft:main Apr 25, 2023
@mdanish-kh mdanish-kh deleted the handleCachedDirectories branch April 25, 2023 18:23
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.

2 participants