From e4fc0c2e747143a2ffc49b5749e36a506710e41e Mon Sep 17 00:00:00 2001 From: Maas Lalani Date: Fri, 29 Jul 2022 12:56:13 -0400 Subject: [PATCH] docs: fix commit.sh example to not use bashism --- examples/commit.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/commit.sh b/examples/commit.sh index f97a4b6..21c1fc9 100755 --- a/examples/commit.sh +++ b/examples/commit.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # This script is used to write a conventional commit message. # It prompts the user to choose the type of commit as specified in the @@ -14,7 +14,7 @@ TYPE=$(gum choose "fix" "feat" "docs" "style" "refactor" "test" "chore" "revert" SCOPE=$(gum input --placeholder "scope") # Since the scope is optional, wrap it in parentheses if it has a value. -[[ -n "$SCOPE" ]] && SCOPE="($SCOPE)" +test -n "$SCOPE" && 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")