Skip to content

Commit

Permalink
Merge branch 'NEW' of github.com:Ash258/Scoop-Core into statusFix
Browse files Browse the repository at this point in the history
  • Loading branch information
Ash258 committed Dec 28, 2021
2 parents 7616eea + 649f4f5 commit d01acc9
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 34 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

🎉🎉 YAML typed manifest and archived manifest installation support 🎉🎉

- Prompt for the new issue now has correct version in title in case of archived manifest is being downloaded/installed/...
- **Unix**:
- Fix `--version` command under *nix
- Supress errors about environment variables, until fully implemented.
Expand Down
2 changes: 1 addition & 1 deletion bin/update-supporting.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ foreach ($sup in $Sups) {
} catch {
++$problems
debug $_.InvocationInfo
New-IssuePromptFromException -ExceptionMessage $_.Exception.Message
New-IssuePromptFromException -ExceptionMessage $_.Exception.Message -Version $manifest.version

continue
}
Expand Down
7 changes: 4 additions & 3 deletions lib/Helpers.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ function New-IssuePrompt {
.PARAMETER Body
Specifies more details to be posted as issue body.
.PARAMETER Version
Specifies the specific version to be shown in the title of issue.
Specifies the exact version to be shown in the title of issue.
#>
param([String] $Application, [String] $Bucket, [String] $Title, [String[]] $Body, [String] $Version)

Expand All @@ -334,10 +334,11 @@ function New-IssuePrompt {
$Version = $null
}
}

$url = known_bucket_repo $Bucket
$bucketPath = Join-Path $SCOOP_BUCKETS_DIRECTORY $Bucket

if ((Test-Path -LiteralPath $bucketPath -PathType 'Container') -and (Join-Path $bucketPath '.git' | Test-Path -PathType 'Container')) {
if ((Test-Path -LiteralPath $bucketPath) -and (Join-Path $bucketPath '.git' | Test-Path -PathType 'Container')) {
$remote = Invoke-GitCmd -Repository $bucketPath -Command 'config' -Argument '--get', 'remote.origin.url'
# Support ssh and http syntax
# git@PROVIDER:USER/REPO.git
Expand Down Expand Up @@ -421,7 +422,7 @@ class ScoopException: System.Exception {
$this.Message = $Message
}

ScoopException([String] $Message, [String] $Version = '') {
ScoopException([String] $Message, [String] $Version) {
$this.Message = $Message
$this.Version = $Version
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Installation.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function Install-ScoopApplication {
$version = $ResolvedObject.ManifestObject.version

if ($version -match '[^\w\.\-\+_]') {
throw [ScoopException]::new("Invalid manifest|-Manifest version has unsupported character '$($matches[0])'.", $version) # TerminatingError thrown
throw [ScoopException]::new("Invalid manifest|-Manifest version has unsupported character '$($Matches[0])'.", $version) # TerminatingError thrown
}

if ($version -eq 'nightly') {
Expand Down
29 changes: 1 addition & 28 deletions lib/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -139,34 +139,6 @@ function Test-Aria2Enabled {
process { return (Test-HelperInstalled -Helper 'Aria2') -and (get_config 'aria2-enabled' $true) }
}

function Find-Manifest($app, $bucket) {
$manifest, $url = $null, $null

# Check if app is a URL or UNC path
if ($app -match '^(ht|f)tps?://|\\\\') {
$url = $app
$app = appname_from_url $url
$manifest = url_manifest $url
} else {
# Check buckets
$manifest, $bucket = find_manifest $app $bucket

if (!$manifest) {
# Could not find app in buckets: check if it's a local path
$path = $app
# TODO: YAML
if (!$path.endswith('.json')) { $path += '.json' }
if (Test-Path $path) {
$url = "$(Resolve-Path $path)"
$app = appname_from_url $url
$manifest, $bucket = url_manifest $url
}
}
}

return $app, $manifest, $bucket, $url
}

#region TODO: Extract lib/Download.ps1
function dl_with_cache($app, $version, $url, $to, $cookies = $null, $use_cache = $true) {
$cached = cache_path $app $version $url
Expand Down Expand Up @@ -348,6 +320,7 @@ function dl_with_cache_aria2($app, $version, $manifest, $architecture, $dir, $co
Out-UTF8File -Path $urlstxt -Content $urlstxt_content

# Build aria2 command
# TODO: Adopt better approach
$aria2 = "& '$(Get-HelperPath -Helper Aria2)' $($options -join ' ')"

debug $aria2
Expand Down
2 changes: 1 addition & 1 deletion libexec/scoop-uninstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ foreach ($explode in $Applications) {
} catch {
++$Problems
debug $_.InvocationInfo
New-IssuePromptFromException -ExceptionMessage $_.Exception.Message -Application $app -Bucket $bucket
New-IssuePromptFromException -ExceptionMessage $_.Exception.Message -Application $app -Bucket $bucket -Version $_.Exception.Version

continue
}
Expand Down

0 comments on commit d01acc9

Please sign in to comment.