set dotenv-load := true

app_name := env('VERBTIONARY_APP_NAME', 'verbtionary')

install:
  pwsh -c './scripts/Install.ps1'

lint:
  pwsh -c '& ./scripts/Activate.ps1; Invoke-ScriptAnalyzer -Path . -Recurse'
  cd infrastructure && tflint --recursive

format:
  pwsh -c '& ./scripts/Activate.ps1; Invoke-ScriptAnalyzer -Fix -Path . -Recurse'
  cd infrastructure && terraform fmt

start:
  cd service && func start

console:
  pwsh -NoExit -Command "& ./scripts/Activate.ps1"

deploy:
  cd service && func azure functionapp publish '{{ app_name }}'

publish:
  pwsh -c 'Publish-Module -Path . -NuGetApiKey $Env:NUGET_API_KEY -Repository PSGallery'
