Skip to content

Commit

Permalink
Update checker.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
GreatSoshiant committed Sep 12, 2024
1 parent dd30f6c commit ffba311
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions checker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,17 @@ fi
# Function to update Cargo.toml
update_cargo_toml() {
if [ -n "$sdk_repo" ]; then
# Replace with GitHub repo and branch
sed -i '' 's#stylus-sdk = {[^}]*}#stylus-sdk = { git = "'"$sdk_repo"'", branch = "'"$sdk_branch"'" }#' "$1"
sed -i '' 's#stylus-sdk = ".*"#stylus-sdk = { git = "'"$sdk_repo"'", branch = "'"$sdk_branch"'" }#' "$1"
# Replace with GitHub repo and branch (adjusting for GNU or BSD sed)
sed -i.bak 's#stylus-sdk = {[^}]*}#stylus-sdk = { git = "'"$sdk_repo"'", branch = "'"$sdk_branch"'" }#' "$1" || sed -i '' 's#stylus-sdk = {[^}]*}#stylus-sdk = { git = "'"$sdk_repo"'", branch = "'"$sdk_branch"'" }#' "$1"
sed -i.bak 's#stylus-sdk = ".*"#stylus-sdk = { git = "'"$sdk_repo"'", branch = "'"$sdk_branch"'" }#' "$1" || sed -i '' 's#stylus-sdk = ".*"#stylus-sdk = { git = "'"$sdk_repo"'", branch = "'"$sdk_branch"'" }#' "$1"
elif [ -n "$sdk_version" ]; then
# Replace with specific version
sed -i '' 's#stylus-sdk = {[^}]*}#stylus-sdk = "'"$sdk_version"'"#' "$1"
sed -i '' 's#stylus-sdk = ".*"#stylus-sdk = "'"$sdk_version"'"#' "$1"
# Replace with specific version (adjusting for GNU or BSD sed)
sed -i.bak 's#stylus-sdk = {[^}]*}#stylus-sdk = "'"$sdk_version"'"#' "$1" || sed -i '' 's#stylus-sdk = {[^}]*}#stylus-sdk = "'"$sdk_version"'"#' "$1"
sed -i.bak 's#stylus-sdk = ".*"#stylus-sdk = "'"$sdk_version"'"#' "$1" || sed -i '' 's#stylus-sdk = ".*"#stylus-sdk = "'"$sdk_version"'"#' "$1"
fi
}


# Function to process each directory
process_directory() {
local base_dir=$1
Expand Down

0 comments on commit ffba311

Please sign in to comment.