Skip to content

fix(scoop-alias): Prevent overwrite existing file when adding alias#5577

Merged
niheaven merged 10 commits intoScoopInstaller:developfrom
HUMORCE:scoop-alias-1
Apr 8, 2024
Merged

fix(scoop-alias): Prevent overwrite existing file when adding alias#5577
niheaven merged 10 commits intoScoopInstaller:developfrom
HUMORCE:scoop-alias-1

Conversation

@HUMORCE
Copy link
Copy Markdown
Member

@HUMORCE HUMORCE commented Jul 11, 2023

Description

Motivation and Context

This feature exists in the tests, but is not implemented.

How Has This Been Tested?

before:

~\scoop
❯ ni .\shims\scoop-xxx.ps1 | Out-Null
~\scoop
❯ scoop alias add xxx 'new alias'
~\scoop
❯ cat .\shims\scoop-xxx.ps1
# Summary:
new alias
~\scoop
❯

after:

~\scoop
❯ ni .\shims\scoop-xxx.ps1 | Out-Null
~\scoop
❯ scoop alias add xxx 'new alias'
File 'scoop-xxx.ps1' already exists in shims directory.
~\scoop
❯ cat .\shims\scoop-xxx.ps1
~\scoop
❯

bin\test.ps1 in powershell 5 and 7, all passed

Checklist:

  • I have read the Contributing Guide.
  • I have ensured that I am targeting the develop branch.
  • I have updated the documentation accordingly.
  • I have updated the tests accordingly.
  • I have added an entry in the CHANGELOG.

Comment thread test/Scoop-Alias.Tests.ps1
Comment thread test/Scoop-Alias.Tests.ps1
Comment thread libexec/scoop-alias.ps1
rashil2000
rashil2000 previously approved these changes Jan 8, 2024
@niheaven
Copy link
Copy Markdown
Member

niheaven commented Apr 8, 2024

image

niheaven
niheaven previously approved these changes Apr 8, 2024
@niheaven niheaven merged commit 81e7dec into ScoopInstaller:develop Apr 8, 2024
@HUMORCE HUMORCE deleted the scoop-alias-1 branch August 10, 2025 19:57
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.

3 participants