Skip to content

Commit

Permalink
Add script for cleaning up outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
Steve Otteson committed Mar 11, 2021
1 parent 118ea23 commit eebe30e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
6 changes: 6 additions & 0 deletions scripts/CleanOutputs.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

. "$PSScriptRoot\CommonUtils.ps1"

Remove-Directory "$emitterDir\obj"
Remove-Directory "$scraperDir\obj"
Remove-Directory $defaultArtifactsDir
9 changes: 9 additions & 0 deletions scripts/CommonUtils.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ function Create-Directory([string[]] $Path)
}
}

function Remove-Directory([string[]] $Path)
{
if ((Test-Path -Path $Path))
{
Remove-Item $Path -Recurse
}
}

function Replace-Text
{
Param ([string] $path, [hashtable] $items)
Expand Down Expand Up @@ -100,6 +108,7 @@ $emitterDir = "$generationDir\emitter"
$partitionsDir = "$scraperDir\Partitions"
$sdkApiPath = "$rootDir\ext\sdk-api"
$sdkGeneratedSourceDir = "$emitterDir\generated"
$defaultArtifactsDir = "$rootDir\artifacts"

if (Test-Path -Path $binDir -PathType leaf)
{
Expand Down
5 changes: 3 additions & 2 deletions scripts/GenerateMetadataSource.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,11 @@ function Replace-Text

if (!$artifactsDir)
{
$artifactsDir = "$rootDir\artifacts"
Create-Directory $artifactsDir
$artifactsDir = $defaultArtifactsDir
}

Create-Directory $artifactsDir

Write-Output "`e[36m*** Generating source files`e[0m"

Write-Output "Making sure cpp NuGet packages are installed..."
Expand Down

0 comments on commit eebe30e

Please sign in to comment.