Skip to content

Commit

Permalink
fix pr comments
Browse files Browse the repository at this point in the history
  • Loading branch information
btc-fan committed Aug 7, 2024
1 parent 341bf45 commit 0a98c65
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
2 changes: 1 addition & 1 deletion scripts/update-go-mod/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
requests==2.32.3
requests==2.32.3
33 changes: 18 additions & 15 deletions scripts/update-go-mod/update-go-mod.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,26 +40,29 @@ def run_go_mod_tidy():
print(f"Failed to run go mod tidy: {e.stderr}")
sys.exit(1)

if __name__ == "__main__":
try:
# Assuming the script is run from the root of mx-chain-simulator-go
go_mod_path = './go.mod'
def main():
# Assuming the script is run from the root of mx-chain-simulator-go
go_mod_path = './go.mod'

if len(sys.argv) != 2:
print("Usage: update-go-mod.py <commit_hash>")
sys.exit(1)

print(f"go.mod path: {go_mod_path}")
latest_commit_hash = sys.argv[1]

if len(sys.argv) != 2:
print("Usage: update-go-mod.py <commit_hash>")
sys.exit(1)
print(f"go.mod path: {go_mod_path}")
print(f"Latest commit hash received: {latest_commit_hash}")

latest_commit_hash = sys.argv[1]
print(f"Latest commit hash received: {latest_commit_hash}")
update_go_mod_file(go_mod_path, latest_commit_hash)

update_go_mod_file(go_mod_path, latest_commit_hash)
# Run go mod tidy after updating go.mod
run_go_mod_tidy()

# Run go mod tidy after updating go.mod
run_go_mod_tidy()
print("Python Script executed successfully.")

print("Python Script executed successfully.")
if __name__ == "__main__":
try:
main()
except Exception as e:
print(f"Script execution failed: {str(e)}")
print(f"Main() Script execution failed: {str(e)}")
sys.exit(1)

0 comments on commit 0a98c65

Please sign in to comment.