From 8a183150043905cc189332de2a5f149bb89830a7 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Fri, 24 May 2024 08:02:41 -0400 Subject: [PATCH] Delete scripts directory as they are replaced with release please --- scripts/BumpPreviewSdkVersion.php | 15 ---- scripts/BumpStableSdkVersion.php | 15 ---- scripts/SdkVersionUtils.php | 139 ------------------------------ 3 files changed, 169 deletions(-) delete mode 100644 scripts/BumpPreviewSdkVersion.php delete mode 100644 scripts/BumpStableSdkVersion.php delete mode 100644 scripts/SdkVersionUtils.php diff --git a/scripts/BumpPreviewSdkVersion.php b/scripts/BumpPreviewSdkVersion.php deleted file mode 100644 index 013281baf72..00000000000 --- a/scripts/BumpPreviewSdkVersion.php +++ /dev/null @@ -1,15 +0,0 @@ - 1) { - # Increment release candidate - $rcVersion = ($rcMatches[1]) ? intval($rcMatches[1]) + 1 : 2; - $splitVersion[2] = "0-RC{$rcVersion}"; - } else { - # Increment minor version - $splitVersion[1] = strval(intval($splitVersion[1]) + 1); - # Set patch - $splitVersion[2] = '0'; - } - return implode(".", $splitVersion); -} - -function updateReadme(string $bumpedVersion) -{ - echo "Reading contents at ".README_FILEPATH."...\n"; - $fileContents = file_get_contents(README_FILEPATH); - if ($fileContents) { - $package = str_replace('/', '\/', PACKAGE_NAME); - $pattern = '/"'.$package.'"\s*:\s*".+"/'; - $replacement = '"'.PACKAGE_NAME.'": "^'.$bumpedVersion.'"'; - $numReplacements = 0; - $updatedContents = preg_replace($pattern, $replacement, $fileContents, -1, $numReplacements); - if (!$numReplacements) { - echo "Unable to find and replace SDK version\n"; - return; - } - echo file_put_contents(README_FILEPATH, $updatedContents) ? "Successfully updated ".README_FILEPATH. "\n" : "Failed to update ".README_FILEPATH."\n"; - return; - } - echo "Could not read contents at ".README_FILEPATH."\n"; -} - -function updateGraphConstants(string $filePath, string $bumpedVersion) -{ - echo "Reading contents at {$filePath}...\n"; - $fileContents = file_get_contents($filePath); - if ($fileContents) { - $pattern = '/'. SDK_VERSION_VAR_NAME . '\s+=\s+".+"/'; - $replacement = SDK_VERSION_VAR_NAME . " = \"{$bumpedVersion}\""; - $numReplacements = 0; - $updatedContents = preg_replace($pattern, $replacement, $fileContents, -1, $numReplacements); - if (!$numReplacements) { - echo "Unable to find and replace SDK version\n"; - return; - } - echo file_put_contents($filePath, $updatedContents) ? "Successfully updated {$filePath}\n" : "Failed to update {$filePath}\n"; - return; - } - echo "Could not read contents at {$filePath}\n"; -}