Skip to content

Commit 974f7f5

Browse files
committed
Merge branch 'dev'
2 parents 087e130 + c8124b7 commit 974f7f5

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

bin/Publish.ps1

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55

66
param([string]$Tag)
77

8-
throw "not ready for use"
9-
108
function AbortIfProcessFailed {
119
param([string]$message)
1210
if ($LASTEXITCODE) { throw $message }
@@ -24,6 +22,13 @@ function AbortIfGitNotAvailable {
2422
get-command git -erroraction stop > $null
2523
}
2624

25+
function AbortIfNotOnMaster {
26+
if (@(git branch | select-string "* master" -simplematch).Count -eq 0) {
27+
throw "not on 'master' branch"
28+
exit 1
29+
}
30+
}
31+
2732
$toDelete = @(
2833
"manifest.json",
2934
"tests",
@@ -32,6 +37,7 @@ $toDelete = @(
3237

3338
AbortIfGitNotAvailable
3439
AbortIfDirtyWorkingDirectory
40+
AbortIfNotOnMaster
3541

3642
try {
3743
push-location $PSScriptRoot\..

0 commit comments

Comments
 (0)