Skip to content

Instantly share code, notes, and snippets.

@Lemorz56
Lemorz56 / pscom.ps1
Last active December 3, 2023 17:31
Convetional Commit Ps1 script with GUM
# Requires: go install github.com/charmbracelet/gum@latest
function pscom() {
$TYPE = (gum choose "fix" "feat" "docs" "perf" "refacor" "style" "test" "chore" "revert")
$SCOPE = (gum input --placeholder "scope")
# Since the scope is optional, wrap it in parentheses if it has a value.
if ($SCOPE -ne "") { $SCOPE = "($SCOPE)" }
# Pre-populate the input with the type(scope): so that the user may change it
$SUMMARY = (gum input --value "$TYPE$SCOPE`: " --placeholder "Summary of this change")
package main
import (
"errors"
"fmt"
"os"
"path"
"runtime/debug"
"time"
)

Keybase proof

I hereby claim:

  • I am lemorz56 on github.
  • I am lemorz56 (https://keybase.io/lemorz56) on keybase.
  • I have a public key ASC0p3vpMfqSpoLT10uEi7kN84ov-ks3DoKdFz5sHhbB6Qo

To claim this, I am signing this object: