Skip to content

Commit

Permalink
Merge branch 'develop' into 'master' (#4594)
Browse files Browse the repository at this point in the history
Related PRs:
- #4531 @filmor 
  - ac71fcc @niheaven 
- #4535 @rashil2000 
- #4522 @pratikpc 
- #4550 @niheaven 
- #4528 @niheaven 
- #4532 @MrNuggelz
- #4155 @MrNuggelz Co-authored-by: @rashil2000 
  - #4581 @niheaven 
  - fb496c4 @rashil2000 
- #4543 @rashil2000 Co-authored-by: @niheaven 
  - #4555 @rashil2000 
  - 3c90d1a @rashil2000 
  - 2ec00d5 @rashil2000 
- #4567 @rashil2000 
  - cbe29ed @rashil2000 
- #4570 @niheaven 
  - #4582 @niheaven 
- #4571 @niheaven 
- #3244 @nickbudi 
- #3821 @jfastnacht Co-authored-by: @rasa 
- #4578 @tukanos
- #4579 @rashil2000 

Co-authored-by: Hsiao-nan Cheung <niheaven@gmail.com>
Co-authored-by: Rashil Gandhi <46838874+rashil2000@users.noreply.github.com>
Co-authored-by: Jakub Čábera <cabera.jakub@gmail.com>
Co-authored-by: Ross Smith II <ross@smithii.com>
Co-authored-by: Benedikt Reinartz <filmor@gmail.com>
Co-authored-by: Joris <MrNuggelz@users.noreply.github.com>
Co-authored-by: Pratik Chowdhury <pratikc@live.co.uk>
Co-authored-by: Rashil Gandhi <rashil2000@gmail.com>
Co-authored-by: nickbudi <nickbudi@users.noreply.github.com>
Co-authored-by: Julian <github@fastnacht.consulting>
Co-authored-by: tukanos <patrik.svestka@gmail.com>
  • Loading branch information
11 people authored Dec 25, 2021
1 parent 6c6a2ca commit 1dbab1f
Show file tree
Hide file tree
Showing 22 changed files with 375 additions and 169 deletions.
2 changes: 2 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
Failing to do so will most likely result in closing of this PR without any explanation.
It is also mandatory to open a relevant issue for discussion with the maintainers,
before creating any new PR.
Read the contributing guide first to save both your and our time.
-->

#### Description
Expand All @@ -27,5 +28,6 @@ Relates to #XXXX
#### Checklist:
<!-- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
- [ ] I have read the [Contributing Guide](https://github.com/ScoopInstaller/.github/blob/main/.github/CONTRIBUTING.md).
- [ ] I have updated the documentation accordingly.
- [ ] I have updated the tests accordingly.
25 changes: 22 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,22 @@ $env:SCOOP_GLOBAL='F:\GlobalScoopApps'
# run the installer
```

### Configure Scoop to store downloads to a Custom Directory by changing `SCOOP_CACHE`

```powershell
$env:SCOOP_CACHE='F:\ScoopCache'
[Environment]::SetEnvironmentVariable('SCOOP_CACHE', $env:SCOOP_CACHE, 'Machine')
# run the installer
```

### Configure Scoop to use a GitHub API token during searching and checkver by setting `SCOOP_CHECKVER_TOKEN`

```powershell
$env:SCOOP_CHECKVER_TOKEN='<paste-token-here>'
[Environment]::SetEnvironmentVariable('SCOOP_CHECKVER_TOKEN', $env:SCOOP_CHECKVER_TOKEN, 'Machine')
# search for an app
```

## [Documentation](https://github.com/ScoopInstaller/Scoop/wiki)

## Multi-connection downloads with `aria2`
Expand All @@ -115,6 +131,7 @@ You can tweak the following `aria2` settings with the `scoop config` command:
- [aria2-split](https://aria2.github.io/manual/en/html/aria2c.html#cmdoption-s) (default: 5)
- [aria2-max-connection-per-server](https://aria2.github.io/manual/en/html/aria2c.html#cmdoption-x) (default: 5)
- [aria2-min-split-size](https://aria2.github.io/manual/en/html/aria2c.html#cmdoption-k) (default: 5M)
- [aria2-options](https://aria2.github.io/manual/en/html/aria2c.html#options) (default: )

## Inspiration

Expand All @@ -129,6 +146,10 @@ Since installers are common, Scoop supports them too (and their uninstallers).

Scoop is also great at handling single-file programs and Powershell scripts. These don't even need to be compressed. See the [runat](https://github.com/ScoopInstaller/Main/blob/master/bucket/runat.json) package for an example: it's really just a GitHub gist.

### Contribute to this project

If you'd like to improve Scoop by adding features or fixing bugs, please read our [Contributing Guide](https://github.com/ScoopInstaller/.github/blob/main/.github/CONTRIBUTING.md).

### Support this project

If you find Scoop useful and would like to support ongoing development and maintenance, here's how:
Expand All @@ -145,8 +166,6 @@ The following buckets are known to scoop:
- [nerd-fonts](https://github.com/matthewjberger/scoop-nerd-fonts) - Nerd Fonts
- [nirsoft](https://github.com/kodybrown/scoop-nirsoft) - Almost all of the [250+](https://rasa.github.io/scoop-directory/by-apps#kodybrown_scoop-nirsoft) apps from [Nirsoft](https://nirsoft.net)
- [java](https://github.com/ScoopInstaller/Java) - A collection of Java development kits (JDKs), Java runtime engines (JREs), Java's virtual machine debugging tools and Java based runtime engines.
- [jetbrains](https://github.com/Ash258/Scoop-JetBrains) - Installers for all JetBrains utilities and IDEs
<!-- * [nightlies](https://github.com/ScoopInstaller/Nightlies) - No longer used -->
- [nonportable](https://github.com/TheRandomLabs/scoop-nonportable) - Non-portable apps (may require UAC)
- [php](https://github.com/ScoopInstaller/PHP) - Installers for most versions of PHP
- [versions](https://github.com/ScoopInstaller/Versions) - Alternative versions of apps found in other buckets
Expand All @@ -162,4 +181,4 @@ scoop bucket add extras

## Other application buckets

Many other application buckets hosted on Github can be found in the [Scoop Directory](https://github.com/rasa/scoop-directory).
Many other application buckets hosted on Github can be found in the [Scoop Directory](https://rasa.github.io/scoop-directory/) or via [other search engines](https://rasa.github.io/scoop-directory/#other-search-engines).
33 changes: 18 additions & 15 deletions bin/auto-pr.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,21 @@
.SYNOPSIS
Updates manifests and pushes them or creates pull-requests.
.DESCRIPTION
Updates manifests and pushes them directly to the master branch or creates pull-requests for upstream.
Updates manifests and pushes them directly to the origin branch or creates pull-requests for upstream.
.PARAMETER Upstream
Upstream repository with the target branch.
Must be in format '<user>/<repo>:<branch>'
.PARAMETER OriginBranch
Origin (local) branch name.
.PARAMETER App
Manifest name to search.
Placeholders are supported.
.PARAMETER Dir
The directory where to search for manifests.
.PARAMETER Push
Push updates directly to 'origin master'.
Push updates directly to 'origin branch'.
.PARAMETER Request
Create pull-requests on 'upstream master' for each update.
Create pull-requests on 'upstream branch' for each update.
.PARAMETER Help
Print help to console.
.PARAMETER SpecialSnowflakes
Expand All @@ -37,6 +39,7 @@ param(
$true
})]
[String] $Upstream,
[String] $OriginBranch = 'master',
[String] $App = '*',
[Parameter(Mandatory = $true)]
[ValidateScript( {
Expand Down Expand Up @@ -65,12 +68,12 @@ if ((!$Push -and !$Request) -or $Help) {
Usage: auto-pr.ps1 [OPTION]
Mandatory options:
-p, -push push updates directly to 'origin master'
-r, -request create pull-requests on 'upstream master' for each update
-p, -push push updates directly to 'origin branch'
-r, -request create pull-requests on 'upstream branch' for each update
Optional options:
-u, -upstream upstream repository with target branch
only used if -r is set (default: lukesampson/scoop:master)
-o, -originbranch origin (local) branch name
-h, -help
'@
exit 0
Expand Down Expand Up @@ -104,7 +107,7 @@ function pull_requests($json, [String] $app, [String] $upstream, [String] $manif
$homepage = $json.homepage
$branch = "manifest/$app-$version"

execute 'hub checkout master'
execute "hub checkout $OriginBranch"
Write-Host "hub rev-parse --verify $branch" -ForegroundColor Green
hub rev-parse --verify $branch

Expand Down Expand Up @@ -141,7 +144,7 @@ a new version of [$app]($homepage) is available.
| New version | $version |
"@

hub pull-request -m "$msg" -b '$upstream' -h '$branch'
hub pull-request -m "$msg" -b "$upstream" -h "$branch"
if ($LASTEXITCODE -gt 0) {
execute 'hub reset'
abort "Pull Request failed! (hub pull-request -m '${app}: Update to version $version' -b '$upstream' -h '$branch')"
Expand All @@ -150,11 +153,11 @@ a new version of [$app]($homepage) is available.

Write-Host 'Updating ...' -ForegroundColor DarkCyan
if ($Push) {
execute 'hub pull origin master'
execute 'hub checkout master'
execute "hub pull origin $OriginBranch"
execute "hub checkout $OriginBranch"
} else {
execute 'hub pull upstream master'
execute 'hub push origin master'
execute "hub pull upstream $OriginBranch"
execute "hub push origin $OriginBranch"
}

. "$PSScriptRoot\checkver.ps1" -App $App -Dir $Dir -Update -SkipUpdated:$SkipUpdated
Expand Down Expand Up @@ -198,10 +201,10 @@ hub diff --name-only | ForEach-Object {

if ($Push) {
Write-Host 'Pushing updates ...' -ForegroundColor DarkCyan
execute 'hub push origin master'
execute "hub push origin $OriginBranch"
} else {
Write-Host 'Returning to master branch and removing unstaged files ...' -ForegroundColor DarkCyan
execute 'hub checkout -f master'
Write-Host "Returning to $OriginBranch branch and removing unstaged files ..." -ForegroundColor DarkCyan
execute "hub checkout -f $OriginBranch"
}

execute 'hub reset --hard'
2 changes: 1 addition & 1 deletion bin/checkhashes.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
Manifests without mismatch will not be shown.
.PARAMETER UseCache
Downloaded files will not be deleted after script finish.
Should not be used, because check should be used for downloading actual version of file (as normal user, not finding in some document from vendors, which could be damaged / wrong (Example: Slack@3.3.1 lukesampson/scoop-extras#1192)), not some previously downloaded.
Should not be used, because check should be used for downloading actual version of file (as normal user, not finding in some document from vendors, which could be damaged / wrong (Example: Slack@3.3.1 ScoopInstaller/Extras#1192)), not some previously downloaded.
.EXAMPLE
PS BUCKETROOT> .\bin\checkhashes.ps1
Check all manifests for hash mismatch.
Expand Down
8 changes: 7 additions & 1 deletion bin/checkver.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,13 @@ while ($in_progress -gt 0) {
}

if ($jsonpath) {
$ver = json_path $page $jsonpath
# Return only a single value if regex is absent
$noregex = [String]::IsNullOrEmpty($regex)
# If reverse is ON and regex is ON,
# Then reverse would have no effect because regex handles reverse
# on its own
# So in this case we have to disable reverse
$ver = json_path $page $jsonpath $null ($reverse -and $noregex) $noregex
if (!$ver) {
$ver = json_path_legacy $page $jsonpath
}
Expand Down
4 changes: 1 addition & 3 deletions buckets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
"main": "https://github.com/ScoopInstaller/Main",
"extras": "https://github.com/ScoopInstaller/Extras",
"versions": "https://github.com/ScoopInstaller/Versions",
"nightlies": "https://github.com/ScoopInstaller/Nightlies",
"nirsoft": "https://github.com/kodybrown/scoop-nirsoft",
"php": "https://github.com/ScoopInstaller/PHP",
"nerd-fonts": "https://github.com/matthewjberger/scoop-nerd-fonts",
"nonportable": "https://github.com/TheRandomLabs/scoop-nonportable",
"java": "https://github.com/ScoopInstaller/Java",
"games": "https://github.com/Calinou/scoop-games",
"jetbrains": "https://github.com/Ash258/Scoop-JetBrains"
"games": "https://github.com/Calinou/scoop-games"
}
Loading

0 comments on commit 1dbab1f

Please sign in to comment.