Created
February 4, 2019 21:17
-
-
Save toddwseattle/bf982859b51d82a89f7a928d0e91564b to your computer and use it in GitHub Desktop.
Powershell Fragment to make debugging firebase functions with the google cloud functions emulator easier
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To use from command line . .\func-help.ps1 Start-FBFuncDeployDebug | |
# (c) Todd Warren 2018 free for all to use with attribution | |
function Start-FBFuncDeployDebug { | |
Param( [parameter(Position = 0, Mandatory = $true)][String]$functionName, [parameter(Position = 1, Mandatory = $false)][Int32]$timeout = 600) | |
$fdeploy = "functions deploy " + $functionName + " --trigger-http --timeout " + $timeout + 's' | |
$finspect = "functions inspect " + $functionName + " --pause" | |
Write-Output $fdeploy | |
Write-Output $finspect | |
Invoke-Expression -Command $fdeploy | |
Invoke-Expression -Command $finspect | |
} | |
function Start-FBFuncDeployOnly { | |
Param( [parameter(Position = 0, Mandatory = $true)][String]$functionName, [parameter(Position = 1, Mandatory = $false)][Int32]$timeout = 600) | |
$fdeploy = "functions deploy " + $functionName + " --trigger-http --timeout " + $timeout + 's' | |
Write-Output $fdeploy | |
Invoke-Expression -Command $fdeploy | |
} | |
Set-Alias -Name "fbdd" -Value "Start-FBFuncDeployDebug" -Description "Deploy and debug a function" | |
Set-Alias -Name "fbd" -Value "Start-FBFuncDeployOnly" -Description "Deploy a function" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment