-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
feat(scoop-shim): Add scoop shim
to manipulate shims
#4736
Conversation
Some notes:
|
For so many shim items, Table View is more compact.
I can do this, and it is my first thought when writing the function. But I wonder who needs such an object even if we return it? For clear result display, a List View of ScoopShim should be added.
Sure, will do it. |
I wonder how many results it would typically return. Won't it be 2 or 3 at max?
Right now we don't need, but in future someone might xD. Also, it looks a lot nicer.
Yes, that's what I had in mind. |
If you just want a full 'list' (a.k.a. |
Hmm, understood. |
Since |
After this is merged, Scoop Core could be bumped to version 0.9.0.0. This is a wonderful version IMO, isn't it? |
Sure thing. Will review later today. Pretty big PR xD |
I have made a commit for minor styling stuff, please pull. Doubt: when will a shim be hidden? Do you have an example? |
Another suggestion: it would be useful to show if a shim is custom-made while doing |
For some internal alias or some command from other apps that has high priority ~ took 22m12s
❯ scoop shim list | ? { $_.IsHidden }
Name Source Alternatives IsGlobal IsHidden
---- ------ ------------ -------- --------
ar busybox False True
bash busybox False True
cat coreutils-uutils False True
clear busybox False True
cp coreutils-uutils False True
diff diffutils False True
dos2unix busybox False True
dotnet dotnet-sdk False True
echo coreutils-uutils False True
env coreutils-uutils False True
expand coreutils-uutils False True
find busybox False True
getopt busybox False True
hostname coreutils-uutils False True
iconv busybox False True |
So a hidden shim is one app's shim, that's been overwritten by another app's shim? |
A hidden shim is an inaccessible one, for example I've ~
❯ scoop which curl
C:\WINDOWS\system32\curl.exe
~
❯ Get-Command curl -All
CommandType Name Version Source
----------- ---- ------- ------
Application curl.exe 7.79.1.0 C:\WINDOWS\system32\curl.exe
Application curl.exe 0.0.0.0 D:\Scoop\shims\curl.exe
~
❯ scoop shim info curl
Name : curl
Path : D:\Scoop\shims\curl.exe
Source : curl
Type : Application
IsGlobal : False
IsHidden : True The same to some Windows alias, e.g., |
6b6ef5c
to
00de264
Compare
Will review later today - I have my exams going on 😅 |
Aha, good luck! |
I'll merge this one and #4734 and plan to next Core release. If there's some bug or improvement, comment here and I'll make hotfix. |
Reviewing now |
This doesn't work. For example, both the following commands will create a global shim, without any shim args:
|
I think we can just avoid all the manual handling hassle by doing |
PowerShell handle
|
How will we tell users about the reasoning/semantics behind this? This would be confusing IMO. |
Yes, it is. I'll change the syntax and hope there are no bugs. |
Check the last commit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works now!
(Tested in PS 7.1.2).
Just some minor comments
Co-authored-by: Rashil Gandhi <46838874+rashil2000@users.noreply.github.com>
Description
Add a new
scoop shim
command, with following subcommand:scoop shim add <shim_name> <command_path>
command_path
should be full path or shim name or external programcommand_path
has whitespaces or has arguments, use quotesscoop shim remove <shim_names>
scoop shim list [<shim_name>]
scoop shim info <shim_name>
scoop shim alter <shim_name>
I borrowed some ideas from #4718 (thanks to @rashil2000) to show shims list table view and make some tweaks to
scoop list
command.Motivation and Context
Closes #3303
Relates to #4727
How Has This Been Tested?
Checklist:
I have updated the tests accordingly.