mirror of
https://github.com/shelljs/shelljs.git
synced 2026-01-18 16:03:37 +00:00
* chore(changelog): add scripts * docs(release): update release docs * chore(editorconfig): add config * docs(changelog): updated by levithomason
29 lines
834 B
Bash
29 lines
834 B
Bash
#!/usr/bin/env bash
|
|
|
|
# Creates a changelog for the current build and puts it in the root
|
|
# Commits the changelog if it updated
|
|
# Does not push commit
|
|
|
|
run() {
|
|
echo "...generating changelog (be patient)"
|
|
|
|
curl -X POST -s "github-changelog-api.herokuapp.com/shelljs/shelljs" > CHANGELOG.md
|
|
|
|
local changelog_was_updated=false
|
|
for file in $(git ls-files --exclude-standard --modified --others); do
|
|
[[ ${file} == "CHANGELOG.md" ]] && changelog_was_updated=true
|
|
done
|
|
|
|
if ${changelog_was_updated}; then
|
|
echo "...committing updated changelog"
|
|
local current_user=$(git config user.name || echo "unknown")
|
|
git add CHANGELOG.md
|
|
git commit -m "docs(changelog): updated by $current_user"
|
|
echo "Done. You can now 'git push' the updated changelog."
|
|
else
|
|
echo "CHANGELOG.md already up-to-date."
|
|
fi
|
|
}
|
|
|
|
run
|