Metadrop / scripthor

Swiss knife of scripts for speed up the development on drupal projects.
1 stars 10 forks source link

Use local git author on update script instead a custom one #19

Closed Eduardo-Morales-Alberti closed 2 years ago

Eduardo-Morales-Alberti commented 3 years ago

Use local git author if parameter author is not defined on update script instead of example.

https://github.com/Metadrop/scripthor/blob/1.x/bin/update-helper.sh#L51

author=${1:-"SCRIPTHOR <user@example.com>"}
jorgetutor commented 3 years ago

The easiest way is to only force the author if it is specified

if it is not defined:

git add config && git commit -m "CONFIG - Consolidate current config stored in database" -n

if it is:

git add config && git commit -m "CONFIG - Consolidate current config stored in database" --author="$author" -n

rsanzante commented 2 years ago

This is already in the codebase. $author_commit is defined as "", and if the author parameter is present it is set to:

author_commit="--author=\"$author\""

And finally, the comand is:

git add config && git commit -m "CONFIG - Consolidate current config stored in database" "$author_commit" -n  || echo "No changes to commit"

If $author_commit is empty no author is specified.