Skip to content

Commit

Permalink
Publish-WikiContent: Fix code style and moved verbose statement (#91)
Browse files Browse the repository at this point in the history
- `Publish-WikiContent`
  - Fix code style in tests.
  - Moved verbose statement so it is only outputted in the right context.
  • Loading branch information
johlju authored Jul 7, 2021
1 parent d79b424 commit ae1350e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `Publish-WikiContent`
- Remove a unnecessary `Set-Location` so it is possible to remove the
temporary folder.
- Fix code style in tests.
- Moved verbose statement so it is only outputted in the right context.

## [0.8.3] - 2021-04-10

Expand Down
4 changes: 2 additions & 2 deletions source/Public/Publish-WikiContent.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@ function Publish-WikiContent

try
{
Write-Verbose -Message $script:localizedData.ConfigGlobalGitMessage

if ($PSBoundParameters.ContainsKey('GlobalCoreAutoCrLf'))
{
Write-Verbose -Message $script:localizedData.ConfigGlobalGitMessage

$null = Invoke-Git -WorkingDirectory $tempPath.FullName `
-Arguments @( 'config', '--global', 'core.autocrlf', $GlobalCoreAutoCrLf )
}
Expand Down
1 change: 0 additions & 1 deletion source/tasks/Publish_GitHub_Wiki_Content.build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ param

# Synopsis: This task publishes documentation to a GitHub Wiki repository.
task Publish_GitHub_Wiki_Content {

if ([System.String]::IsNullOrEmpty($GitHubToken))
{
Write-Build Yellow 'Skipping task. Variable $GitHubToken not set via parent scope, as an environment variable, or passed to the build task.'
Expand Down
16 changes: 8 additions & 8 deletions tests/unit/public/Publish-WikiContent.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ InModuleScope $script:moduleName {

Mock -CommandName Invoke-Git -MockWith {
return @{
'ExitCode' = 128
'StandardOutput' = 'Standard Output 128'
'StandardError' = 'fatal: remote error: access denied or repository not exported: /335792891.wiki.git'
}
'ExitCode' = 128
'StandardOutput' = 'Standard Output 128'
'StandardError' = 'fatal: remote error: access denied or repository not exported: /335792891.wiki.git'
}
} -ParameterFilter {
$Arguments[0] -eq 'clone' -and
$Arguments[1] -eq "https://github.com/$($mockPublishWikiContentParameters.OwnerName)/$($mockPublishWikiContentParameters.RepositoryName).wiki.git"
Expand Down Expand Up @@ -144,10 +144,10 @@ InModuleScope $script:moduleName {

Mock -CommandName Invoke-Git -MockWith {
return @{
'ExitCode' = 0
'StandardOutput' = 'Standard Output 0'
'StandardError' = 'Standard Error 0'
}
'ExitCode' = 0
'StandardOutput' = 'Standard Output 0'
'StandardError' = 'Standard Error 0'
}
}
}

Expand Down

0 comments on commit ae1350e

Please sign in to comment.