From 49078f082d437109cc387edab8347676137625fb Mon Sep 17 00:00:00 2001 From: Patrick Stewart Date: Sun, 14 Jul 2024 22:56:41 -0700 Subject: [PATCH] add: adding github project script patterns --- scripts/bootstrap | 0 scripts/cibuild | 0 scripts/console | 0 scripts/server | 0 scripts/setup | 0 scripts/test | 0 scripts/update | 0 scripts/update_version.sh | 45 --------------------------------------- 8 files changed, 45 deletions(-) create mode 100644 scripts/bootstrap create mode 100644 scripts/cibuild create mode 100644 scripts/console create mode 100644 scripts/server create mode 100644 scripts/setup create mode 100644 scripts/test create mode 100644 scripts/update delete mode 100755 scripts/update_version.sh diff --git a/scripts/bootstrap b/scripts/bootstrap new file mode 100644 index 0000000..e69de29 diff --git a/scripts/cibuild b/scripts/cibuild new file mode 100644 index 0000000..e69de29 diff --git a/scripts/console b/scripts/console new file mode 100644 index 0000000..e69de29 diff --git a/scripts/server b/scripts/server new file mode 100644 index 0000000..e69de29 diff --git a/scripts/setup b/scripts/setup new file mode 100644 index 0000000..e69de29 diff --git a/scripts/test b/scripts/test new file mode 100644 index 0000000..e69de29 diff --git a/scripts/update b/scripts/update new file mode 100644 index 0000000..e69de29 diff --git a/scripts/update_version.sh b/scripts/update_version.sh deleted file mode 100755 index 3ef9eca..0000000 --- a/scripts/update_version.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash - -# Function to update version in pubspec.yaml -update_version() { - local directory=$1 - local new_version=$2 - - pubspec_file="$directory/pubspec.yaml" - - if [[ -f $pubspec_file ]]; then - echo "Updating version in $pubspec_file to $new_version" - sed -i.bak -E "s/^version: .*/version: $new_version/" $pubspec_file - if [[ $? -eq 0 ]]; then - echo "Version updated successfully in $directory" - else - echo "Failed to update version in $directory" - fi - else - echo "pubspec.yaml not found in $directory" - fi -} - -# Main script logic -main() { - local target_dir=$1 - local new_version=$2 - - if [[ -z $target_dir || -z $new_version ]]; then - echo "Usage: $0 " - exit 1 - fi - - packages_dir="packages" - - if [[ $target_dir == "all" ]]; then - for dir in $packages_dir/*/; do - update_version "$dir" "$new_version" - done - else - update_version "$packages_dir/$target_dir" "$new_version" - fi -} - -# Call the main function with provided arguments -main "$@"