Skip to content

Commit

Permalink
lint(buckets): Remove not needed function [shovel skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
Ash258 committed Oct 29, 2020
1 parent 79cfc4d commit 5a58045
Showing 1 changed file with 0 additions and 38 deletions.
38 changes: 0 additions & 38 deletions lib/buckets.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -141,44 +141,6 @@ function Remove-Bucket {
}
}

# TODO: Drop/Deprecate
function new_issue_msg($app, $bucket, $title, $body) {
$app, $manifest, $bucket, $url = Find-Manifest $app $bucket
$url = known_bucket_repo $bucket
$bucket_path = Join-Path $SCOOP_BUCKETS_DIRECTORY $bucket

if ((Test-Path $bucket_path) -and (Join-Path $bucket_path '.git' | Test-Path -PathType Container)) {
$remote = Invoke-GitCmd -Repository $bucket_path -Command 'config' -Argument '--get', 'remote.origin.url'
# Support ssh and http syntax
# git@PROVIDER:USER/REPO.git
# https://PROVIDER/USER/REPO.git
# https://regex101.com/r/OMEqfV
if ($remote -match '(?:@|:\/\/)(?<provider>.+?)[:\/](?<user>.*)\/(?<repo>.+?)(?:\.git)?$') {
$url = "https://$($Matches.Provider)/$($Matches.User)/$($Matches.Repo)"
}
}

if (!$url) { return 'Please contact the bucket maintainer!' }

$title = [System.Web.HttpUtility]::UrlEncode("$app@$($manifest.version): $title")
$body = [System.Web.HttpUtility]::UrlEncode($body)
$msg = "`nPlease try again"

switch -Wildcard ($url) {
'*github.*' {
$url = $url -replace '\.git$'
$url = "$url/issues/new?title=$title"
if ($body) { $url += "&body=$body" }
$msg = "$msg or create a new issue by using the following link and paste your console output:"
}
default {
Write-UserMessage -Message 'Not supported platform' -Info
}
}

return "$msg`n$url"
}

#region Deprecated
function bucketdir($name) {
Show-DeprecatedWarning $MyInvocation 'Find-BucketDirectory'
Expand Down

0 comments on commit 5a58045

Please sign in to comment.