-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPush-Github.ps1
More file actions
27 lines (23 loc) · 764 Bytes
/
Push-Github.ps1
File metadata and controls
27 lines (23 loc) · 764 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
[CmdletBinding()]
param (
[Parameter(Mandatory = $true)]
[ValidateScript( {
if ( -Not ($_ | Test-Path) ) {
throw "Folder does not exist"
}
if (-Not ($_ | Test-Path -PathType Container) ) {
throw "The Path argument must be a folder. File paths are not allowed."
}
return $true
})]
[System.IO.FileInfo]$GitRepoDirectory
)
. .\Utils\Git.ps1
try {
Write-Host "Pushing local git repo to Github..." -ForegroundColor White
Push-Git -RepoDirectory $GitRepoDirectory | Out-Null
Write-Host "Successfully pushed local git repo to Github." -ForegroundColor Green
}
catch {
Write-Error "Failed to push local git repo to Github. Reason: $($_)"
}