From 44b65b844f4d3cb22cb77a5677ec5ed914864482 Mon Sep 17 00:00:00 2001 From: oxmc Date: Wed, 28 Dec 2022 23:17:23 -0800 Subject: [PATCH] Update gitignore and start changelog generator --- .gitignore | 3 +++ gen-changelog | 27 +++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 gen-changelog diff --git a/.gitignore b/.gitignore index 6704566..25a3413 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +# Custom files +bundle.php + # Logs logs *.log diff --git a/gen-changelog b/gen-changelog new file mode 100644 index 0000000..dcd152a --- /dev/null +++ b/gen-changelog @@ -0,0 +1,27 @@ +#!/bin/bash + +#Validate input: +if [ -z "$1" ]; then + echo "Github user not provided" && exit 1 +fi + +if [ -z "$2" ]; then + echo "Github project not provided" && exit 1 +fi + +#Get token: +if [ -z "$CHANGELOG_GITHUB_TOKEN" ]; then + if [ ! -z "$3" ]; then + source "$3" || echo "Unable to fetch credentials, the file either does not exist, or is not an actual file." && exit 1 + else + echo 'Unable to find your github credentials file, please double chek the file exists and has the $CHANGELOG_GITHUB_TOKEN variable set.' && exit 1 + fi +else + echo 'Unable to find your github credentials token, please make sure your $CHANGELOG_GITHUB_TOKEN variable is set, or pass a path to a credentials file.' && exit 1 +fi + +#Check for output option: +$CLOUT = "./changelog.md" + +#Generate changelog: +github_changelog_generator -u "$1" -p "$2" --output "$CLOUT"