Skip to content

refactor(cmd_available/Get-Command): Add Test-CommandAvailable function#3314

Merged
r15ch13 merged 6 commits intoScoopInstaller:developfrom
niheaven:use-cmd_available
Apr 28, 2019
Merged

refactor(cmd_available/Get-Command): Add Test-CommandAvailable function#3314
r15ch13 merged 6 commits intoScoopInstaller:developfrom
niheaven:use-cmd_available

Conversation

@niheaven
Copy link
Copy Markdown
Member

@niheaven niheaven commented Apr 9, 2019

A 5 years old function cmd_available is aiming to check existence of $cmd (used to check 7z, innounp), and can replace Get-Command with a [Boolean] output.

@niheaven niheaven changed the title cmd_available: Used instead of Get-Command cmd_available: Use instead of Get-Command Apr 9, 2019
Comment thread lib/core.ps1 Outdated
Ash258 and others added 3 commits April 9, 2019 19:05
Co-Authored-By: niheaven <niheaven@gmail.com>
@niheaven niheaven force-pushed the use-cmd_available branch from 16d6706 to 7469c97 Compare April 9, 2019 11:37
@niheaven
Copy link
Copy Markdown
Member Author

niheaven commented Apr 9, 2019

Change function body to return [Boolean](Get-Command $cmd -ErrorAction Ignore)

@r15ch13
Copy link
Copy Markdown
Member

r15ch13 commented Apr 11, 2019

Since it gets refactored anyway, let's rename it to Test-CommandAvailable to make a small move towards common PowerShell naming conventions 😄

@niheaven
Copy link
Copy Markdown
Member Author

Rename to Test-CommandAvailable

I'll rename functions in #3204 later.

Comment thread test/Scoop-Core.Tests.ps1
@Ash258 Ash258 mentioned this pull request Apr 26, 2019
@niheaven niheaven changed the base branch from master to develop April 27, 2019 00:33
@r15ch13 r15ch13 changed the title cmd_available: Use instead of Get-Command refactor(cmd_available/Get-Command): Add Test-CommandAvailable function Apr 28, 2019
@r15ch13 r15ch13 merged commit a757dea into ScoopInstaller:develop Apr 28, 2019
@niheaven niheaven deleted the use-cmd_available branch April 29, 2019 03:30
r15ch13 added a commit that referenced this pull request May 12, 2019
- The main bucket of Scoop has been separated to https://github.com/ScoopInstaller/Main
- Requires PowerShell 5 and newer #3330
- Improve and refactor decompression functions #3204 #3409 #3411
- Move scoop config from `~\.scoop` to `~\.config\scoop\config.json` #3242
- Add `scoop hold` and `scoop unhold` for excluding programs from updates #3444
- Refactored some Core functions #3314 #3416
- Small fix for starting processes on Windows 7 #3415

Co-authored-by: Hsiao-nan Cheung <niheaven@gmail.com>
Co-authored-by: Chawye Hsu <h404bi@outlook.com>
Co-authored-by: Jakub Čábera <cabera.jakub@gmail.com>
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