Skip to content

Commit f070910

Browse files
jnnsbrrjnnsbrr
authored andcommitted
clear redundancies in release scripts
1 parent bb55a6d commit f070910

2 files changed

Lines changed: 5 additions & 22 deletions

File tree

scripts/release.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ echo "Linting passed successfully."
5555
# 5. Update CITATION.cff and commit changes (only after all checks pass)
5656
echo "Updating CITATION.cff..."
5757
python3 scripts/update_citation.py "$VERSION"
58+
if [ $? -ne 0 ]; then
59+
echo "Error: Failed to update CITATION.cff!"
60+
exit 1
61+
fi
5862

5963
if ! git diff --quiet CITATION.cff; then
6064
echo "CITATION.cff updated, committing changes..."

scripts/update_citation.py

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -121,29 +121,8 @@ def main():
121121
else:
122122
date = None
123123

124-
print(f"Updating CITATION.cff to version {version}")
125124
updated = update_citation_file(version, date)
126-
127-
if updated:
128-
print("CITATION.cff has been updated!")
129-
130-
# Commit the changes
131-
import subprocess
132-
133-
try:
134-
subprocess.run(["git", "add", "CITATION.cff"], check=True)
135-
subprocess.run(
136-
["git", "commit", "-m", f"Update CITATION.cff to version {version}"],
137-
check=True,
138-
)
139-
print("CITATION.cff changes committed successfully")
140-
except subprocess.CalledProcessError as e:
141-
print(f"Warning: Failed to commit CITATION.cff changes: {e}")
142-
143-
sys.exit(0)
144-
else:
145-
print("No changes were made.")
146-
sys.exit(0)
125+
sys.exit(0 if updated else 1)
147126

148127

149128
if __name__ == "__main__":

0 commit comments

Comments
 (0)