Skip to content

Commit

Permalink
fix scripts/write-headers
Browse files Browse the repository at this point in the history
  • Loading branch information
cognifloyd committed Aug 17, 2021
1 parent 854d352 commit 39e6133
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scripts/write-headers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@
# that are used by popular editors and formalized in PEP 263
# https://www.python.org/dev/peps/pep-0263/

HEADER="# NOTE: This file is auto-generated - DO NOT EDIT MANUALLY\\
HEADER="\\
# NOTE: This file is auto-generated - DO NOT EDIT MANUALLY\\
# Instead modify scripts/dist_utils.py and run 'make .sdist-requirements' to\\
# update dist_utils.py files for all components\\
"

if [[ $(uname) == "Linux" ]]; then
sed -i -e "s|^\(# -\*- .*\)$|\1\\n$HEADER|; /^# \/\//d" "$@" || exit 2
sed -i -e "s|^\(# -\*- .*\)$|\1$HEADER|; /^# \/\//d" "$@" || exit 2
elif [[ $(uname) == "Darwin" ]]; then
sed -i '' -e "s|^\(# -\*- .*\)$|\1\\n$HEADER|; /^# \/\//d" "$@" || exit 2
sed -i '' -e "s|^\(# -\*- .*\)$|\1$HEADER|; /^# \/\//d" "$@" || exit 2
else
echo >&2 "Unknown OS"
exit 2
Expand Down

0 comments on commit 39e6133

Please sign in to comment.