From 1593559d8379dd747b49f219e2c2592899d73ad9 Mon Sep 17 00:00:00 2001 From: Chemaclass Date: Sun, 15 Sep 2024 14:21:27 +0200 Subject: [PATCH] feat: rename project from create-pr.sh to create-pr --- .env.example | 4 ++-- .github/CONTRIBUTING.md | 2 +- README.md | 10 +++++----- build.sh | 12 ++++-------- create-pr.sh => create-pr | 0 src/console_header.sh | 4 ++-- tests/e2e/create-pr_test.sh | 6 +++--- ..._pr_test_sh.test_script_with_debug.snapshot | 18 +++++++++--------- 8 files changed, 26 insertions(+), 30 deletions(-) rename create-pr.sh => create-pr (100%) diff --git a/.env.example b/.env.example index e5cc0f8..ea3dae8 100644 --- a/.env.example +++ b/.env.example @@ -1,7 +1,7 @@ -# create-pr.sh +# create-pr PR_TEMPLATE_PATH=".github/PULL_REQUEST_TEMPLATE.md" PR_TITLE_TEMPLATE="{{TICKET_KEY}}-{{TICKET_NUMBER}} {{PR_TITLE}}" -PR_TICKET_LINK_PREFIX="https://github.com/Chemaclass/create-pr.sh/issues/" +PR_TICKET_LINK_PREFIX="https://github.com/Chemaclass/create-pr/issues/" PR_LINK_PREFIX_TEXT="Closes: " PR_LABEL_MAPPING="docs:documentation; fix|bug|bugfix|hotfix:bug; default:enhancement" diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 6cff42b..fd50ae8 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -38,7 +38,7 @@ Please make sure you have [set up your username and email address](https://git-s ## Development -- Entry point `create-pr.sh` +- Entry point `create-pr` - Isolated testable functions inside files under the `src` directory ### Build diff --git a/README.md b/README.md index 5e8fe1d..68daf22 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# create-pr.sh +# create-pr A bash script that helps create your PRs. It normalised the PR title, description, assignee by default and initial label based on your branch name. @@ -16,7 +16,7 @@ Download the latest `single executable script` on the [Releases page](https://gi In case you download the executable file from releases' GitHub project, you can check the file's checksum to validate that it was not altered. The checksum for each release is on each release on GitHub. -To build the project yourself, execute the script `./build.sh` and move the resulting `bin/create-pr.sh` script wherever you want. +To build the project yourself, execute the script `./build.sh` and move the resulting `bin/create-pr` script wherever you want. ## How to use it? @@ -51,11 +51,11 @@ Text to display if the link does not contain a `TICKET_KEY`. Branch name: `feat/27-my-branch-name` ```bash -PR_TICKET_LINK_PREFIX="https://github.com/Chemaclass/create-pr.sh/issues/" +PR_TICKET_LINK_PREFIX="https://github.com/Chemaclass/create-pr/issues/" PR_LINK_PREFIX_TEXT="Closes: " ``` -- Result: `Closes: https://github.com/Chemaclass/create-pr.sh/issues/27` +- Result: `Closes: https://github.com/Chemaclass/create-pr/issues/27` ### PR_TITLE_TEMPLATE @@ -112,7 +112,7 @@ PR_LABEL_MAPPING="docs:documentation; fix|bug|bugfix|hotfix:bug; default:enhance ## HINTS -- Add to your composer, npm or similar a script pointing to the `create-pr.sh` +- Add to your composer, npm or similar a script pointing to the `create-pr` - You can use the [PULL_REQUEST_TEMPLATE](./.github/PULL_REQUEST_TEMPLATE.md) from this project as example ## Contribute diff --git a/build.sh b/build.sh index b235a62..8c0d3ae 100755 --- a/build.sh +++ b/build.sh @@ -17,7 +17,7 @@ function generate_bin() { temp="$(dirname "$out")/temp.sh" echo '#!/bin/bash' > "$temp" - echo "Generating create-pr.sh in the '$(dirname "$out")' folder..." + echo "Generating create-pr in the '$(dirname "$out")' folder..." for file in src/*.sh; do { echo "# $file" @@ -26,7 +26,7 @@ function generate_bin() { } >> "$temp" done - cat create-pr.sh >> "$temp" + cat create-pr >> "$temp" grep -v '^source' "$temp" > "$out" rm "$temp" chmod u+x "$out" @@ -53,9 +53,5 @@ function generate_checksum() { ######### MAIN ######### ######################## -DIR="bin" - -mkdir -p "$DIR" -OUT="bin/create-pr.sh" - -build "$OUT" +mkdir -p "bin" +build "bin/create-pr" diff --git a/create-pr.sh b/create-pr similarity index 100% rename from create-pr.sh rename to create-pr diff --git a/src/console_header.sh b/src/console_header.sh index cf29079..02b6c29 100644 --- a/src/console_header.sh +++ b/src/console_header.sh @@ -7,7 +7,7 @@ function console_header::print_version() { function console_header::print_help() { cat <