Skip to content

Commit

Permalink
update shell command
Browse files Browse the repository at this point in the history
  • Loading branch information
belav committed Jul 1, 2023
1 parent b70ef6d commit 3c8f924
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions Shell/ReviewBranch.psm1
Original file line number Diff line number Diff line change
@@ -1,20 +1,29 @@
function CSH-ReviewBranch {
param (
[string]$folder,
[string]$pathToTestingRepo,
[switch]$fast = $true
)

$repositoryRoot = Join-Path $PSScriptRoot ".."
$csProjectPath = Join-Path $repositoryRoot "Src/CSharpier.Cli/CSharpier.Cli.csproj"
$csharpierDllPath = Join-Path $repositoryRoot "Src/CSharpier.Cli/bin/release/net7.0/dotnet-csharpier.dll"

$location = Get-Location

Set-Location $repositoryRoot

if (!$pathToTestingRepo) {
$pathToTestingRepo = "C:\Projects\csharpier-repos"
}
if ($folder -ne $null) {
$pathToTestingRepo = Join-Path $pathToTestingRepo $folder
}

if (!(Test-Path $pathToTestingRepo)) {
Write-Output "No directory found at $($pathToTestingRepo)."
Write-Output "Please checkout out https://github.com/belav/csharpier-repos there or supply -pathToTestingRepo"
exit 1
return
}

$ErrorActionPreference = "Stop"
Expand All @@ -28,8 +37,11 @@ function CSH-ReviewBranch {

$preBranch = "pre-" + $branch
$postBranch = "post-" + $branch

$location = Get-Location

if ($folder -ne $null) {
$preBranch += "-" + $folder
$postBranch += "-" + $folder
}

Set-Location $pathToTestingRepo
& git reset --hard
Expand Down

0 comments on commit 3c8f924

Please sign in to comment.