diff --git a/Posh-GitHub/Posh-GitHub.nuspec b/Posh-GitHub/Posh-GitHub.nuspec new file mode 100644 index 0000000..d85f0b3 --- /dev/null +++ b/Posh-GitHub/Posh-GitHub.nuspec @@ -0,0 +1,52 @@ + + + + Posh-GitHub + Posh-GitHub - PowerShell GitHub API helpers + 0.0.1 + Ethan J Brown + Ethan J Brown + PowerShell cmdlet helpers for working with GitHub + PowerShell cmdlet helpers for working with the GitHub API. + +* New-GitHubOAuthToken - creates an OAuth token for use with GitHub +* Get-GitHubOAuthTokens - Used to list all the authorizations you have provided +to applications / tooling +* Set-GitHubUserName - Adds the username to the current PowerShell session and +sets a global User environment variable +* Set-GitHubOrganization - Adds the organization to the current PowerShell +session and sets a global User environment variable +* Get-GitHubRepositories - List all your repositories - gives a fork indicator, +a date for when the last update (push) occurred, how many open issues and size +* New-GitHubRepository - Creates a new GitHub repository and clones it locally +by default. +* New-GitHubFork - Forks a repository, clones it locally, then properly adds a +remote named upstream to point back to the parent repository. Aborts if there +is a directory in the current working directory that shares the name of the +repository. +* Get-GitHubIssues - List issues against the repository for the current working +directory, or can list issues against a specific repo and owner. +* New-GitHubPullRequest - Initiates a new pull request to the upstream repo. +* Get-GitHubPullRequests - List pull requests against the repository for the +current working directory, or can list pull requests against all forks from a user. +* Get-GitHubTeams - The default parameterless version will use the GITHUB_ORG +environment variable to get the list of teams, their ids and members. +* Get-GitHubEvents - Will list, in chronological order, the last 30 events that +you have generated +* Clear-GitMergedBranches - Will remove any local branch cruft from branches +that have been merged into the master branch. + + http://github.com/Iristyle/Posh-GitHub/ + powershell shell git github + + false + https://github.com/Iristyle/ChocolateyPackages/raw/master/Posh-GitHub/Posh-GitHub.png + + + + + + + diff --git a/Posh-GitHub/Posh-GitHub.png b/Posh-GitHub/Posh-GitHub.png new file mode 100644 index 0000000..42c1f84 Binary files /dev/null and b/Posh-GitHub/Posh-GitHub.png differ diff --git a/Posh-GitHub/tools/chocolateyInstall.ps1 b/Posh-GitHub/tools/chocolateyInstall.ps1 new file mode 100644 index 0000000..a6682c9 --- /dev/null +++ b/Posh-GitHub/tools/chocolateyInstall.ps1 @@ -0,0 +1,74 @@ +$package = 'Posh-GitHub' +$version = '0.0.1' + +function Get-CurrentDirectory +{ + $thisName = $MyInvocation.MyCommand.Name + [IO.Path]::GetDirectoryName((Get-Content function:$thisName).File) +} + +try { + $current = Get-CurrentDirectory + . (Join-Path $current 'PowerShellHelpers.ps1') + + # find user specific module directory + $moduleDirectory = Get-ModuleDirectory + $installDirectory = Join-Path $moduleDirectory $package + + # unload module if its already loaded + Get-Module -Name $package | Remove-Module + + try + { + if (Test-Path($installDirectory)) + { + Remove-Item $installDirectory -Recurse -Force + } + } + catch + { + Write-Host "Could not remove existing $package folder" + } + + Write-Host "Installing $package to $installDirectory..." + $params = @{ + PackageName = $package; + Url = "https://github.com/Iristyle/Posh-GitHub/zipball/$version"; + UnzipLocation = $moduleDirectory; + } + + Install-ChocolateyZipPackage @params + + # github tarballs are versioned and we don't want that ;0 + Get-ChildItem -Path $moduleDirectory | + ? { $_.Name -match 'Posh\-GitHub' } | + Sort-Object -Property CreationTime -Descending | + Select -First 1 | + Rename-Item -NewName $installDirectory + + if (!(Test-Path $PROFILE)) + { + $profileRoot = Split-Path $PROFILE + New-Item -Path $profileRoot -Type Directory -ErrorAction SilentlyContinue + Set-Content -Path $PROFILE -Value '' -Force -Encoding UTF8 + } + + if (!(Select-String -Pattern 'Posh\-GitHub\-Profile\.ps1' -Path $PROFILE)) + { + $loaderFile = 'Posh-GitHub-Profile.ps1' + "`n`n# Load Posh-GitHub`n. '$installDirectory\$loaderFile'" | + Out-File -FilePath $PROFILE -Append -Encoding UTF8 + . $PROFILE + } + + Write-Host @' +Reload the current profile to access Posh-Github with: +. $PROFILE +'@ + Write-ChocolateySuccess $package +} +catch +{ + Write-ChocolateyFailure $package "$($_.Exception.Message)" + throw +}