-
-
Notifications
You must be signed in to change notification settings - Fork 648
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: resolve authors via .mailmap file for changelog generation
- Loading branch information
1 parent
6fd2e23
commit 4f49bd5
Showing
2 changed files
with
66 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
lib/node_modules/@stdlib/_tools/changelog/generate/scripts/resolve_name_email.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# @license Apache-2.0 | ||
# | ||
# Copyright (c) 2024 The Stdlib Authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# Script for resolving a name and email using .mailmap via `git check-mailmap``. | ||
This comment has been minimized.
Sorry, something went wrong. |
||
# | ||
# Usage: resolve-mailmap.sh "name <email>" | ||
# | ||
# Arguments: | ||
# | ||
# name_email The name and email pair in the format "name <email>" | ||
# | ||
|
||
if [ -z "$1" ]; then | ||
echo "Error: must provide a name and email in the format \"name <email>\"." >&2 | ||
exit 1 | ||
fi | ||
|
||
name_email="$1" | ||
|
||
resolved=$(git check-mailmap "$name_email" 2>/dev/null) | ||
if [ -n "$resolved" ]; then | ||
echo "$resolved" | ||
else | ||
echo "$name_email" | ||
fi |
Extra "`" at the end. Removed.