Skip to content

Commit

Permalink
fix: filter out non-version-like names
Browse files Browse the repository at this point in the history
  • Loading branch information
adrians5j committed Dec 18, 2024
1 parent 4e4de20 commit 0d891cd
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,18 @@ import { CliContext } from "@webiny/cli/types";
import { Ora } from "ora";

const EXTENSIONS_ROOT_FOLDER = "extensions";

const S3_BUCKET_NAME = "webiny-examples";
const S3_BUCKET_REGION = "us-east-1";
const FOLDER_NAME_IS_VERSION_REGEX = /^\d+\.\d+\.x$/;

const getVersionFromVersionFolders = async (
versionFoldersList: string[],
currentWebinyVersion: string
) => {
const availableVersions = versionFoldersList.map(v => v.replace(".x", ".0")).sort();
const availableVersions = versionFoldersList
.filter(v => v.match(FOLDER_NAME_IS_VERSION_REGEX))
.map(v => v.replace(".x", ".0"))
.sort();

let versionToUse = "";

Expand Down

0 comments on commit 0d891cd

Please sign in to comment.