Shift command not working in wrapper script
Posted: 2024-Jan-13, 1:50 am
I am using scoop . The search command is very slow, so there is a drop-in replacement written in Golang which is much faster: https://github.com/shilangyu/scoop-search
While there is a PowerShell function to replace `scoop search [package]` with `scoop-search.exe [package]`, there isn't one for cmd.exe, so I am trying to make one. This wrapper script is what I have come up with, but it isn't working:
The problem is that the `shift` line isn't working for some reason, so the command that gets passed to the shell is `scoop-search search [package]`. How do I get rid of the `search`? Why isn't `shift` doing what I expected?
While there is a PowerShell function to replace `scoop search [package]` with `scoop-search.exe [package]`, there isn't one for cmd.exe, so I am trying to make one. This wrapper script is what I have come up with, but it isn't working:
Code: Select all
@echo off
if "%1" == "search" (
shift
scoop-search.exe %*
) else (
powershell scoop.ps1 %*
)