Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: replace fmt.Sprintf with generateTokenHash #1195

Merged
merged 2 commits into from
Jul 22, 2023

Conversation

J0
Copy link
Contributor

@J0 J0 commented Jul 22, 2023

What kind of change does this PR introduce?

see title - relevant command:

#!/bin/bash

# Function to apply sed command to files in a directory
replace_in_files() {
  # The sed command with the pattern for replacement
  sed -E -i '' 's/fmt\.Sprintf\("%x", sha256\.Sum224\(\[\]byte\(([^+]+)\+([^)]+)\)\)\)/crypto.GenerateTokenHash(\1, \2)/g' "$1"
}

# Check if a directory is provided as an argument
if [ -z "$1" ]; then
  echo "Please provide the directory path as an argument."
  exit 1
fi

# Check if the directory exists
if [ ! -d "$1" ]; then
  echo "Directory not found: $1"
  exit 1
fi

# Loop through all files in the directory and apply the sed command
for file in "$1"/*; do
  if [ -f "$file" ]; then
    replace_in_files "$file"
  fi
done

@J0 J0 marked this pull request as ready for review July 22, 2023 11:01
@J0 J0 requested a review from a team as a code owner July 22, 2023 11:01
Copy link
Contributor

@hf hf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@J0 J0 merged commit ee78f36 into master Jul 22, 2023
1 check passed
@J0 J0 deleted the j0/refactor_generate_token_hash branch July 22, 2023 11:20
@github-actions
Copy link
Contributor

🎉 This PR is included in version 2.84.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants