# setup-sdl: make version input case insensitive + allow sdl prefix + group git fetch SDL commands in one group

**URL:** <https://discourse.libsdl.org/t/setup-sdl-make-version-input-case-insensitive-allow-sdl-prefix-group-git-fetch-sdl-commands-in-one-group/44539>\
**Category:** SDL Commits\
**Created:** [June 30, 2023, 9:40pm UTC](https://discourse.libsdl.org/t/setup-sdl-make-version-input-case-insensitive-allow-sdl-prefix-group-git-fetch-sdl-commands-in-one-group/44539 "2023-06-30T21:40:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SDLPushPostBot](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/sdlpushpostbot/32/4370_2.png) [@SDLPushPostBot](https://discourse.libsdl.org/u/SDLPushPostBot)\
**Post date:** [June 30, 2023, 9:40pm UTC](https://discourse.libsdl.org/t/setup-sdl-make-version-input-case-insensitive-allow-sdl-prefix-group-git-fetch-sdl-commands-in-one-group/44539/1 "2023-06-30T21:40:22Z")

</div>

> <https://github.com/libsdl-org/setup-sdl/commit/0fad19e82b82a3883b6a733b0e2c04acf41c853b>

```diff
From 0fad19e82b82a3883b6a733b0e2c04acf41c853b Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Sat, 17 Jun 2023 05:19:03 +0200
Subject: [PATCH] make version input case insensitive + allow sdl prefix +
 group git fetch SDL commands in one group

---
 action.yml | 2 +-
 packed/index.js | 9 ++++++---
 src/main.ts | 5 ++---
 src/version.ts | 4 ++++
 4 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/action.yml b/action.yml
index 8d36234..2f53fd2 100644
--- a/action.yml
+++ b/action.yml
@@ -3,7 +3,7 @@ description: "Set up SDL and add the path of SDL2.dll to the PATH."
 inputs:
   version:
     description: "Minimum required version of SDL (2.x.y, 2-any, 2-latest, 2-head, 3-head), or git hash"
- default: "2-HEAD"
+ default: "2-any"
     required: true
   pre-release:
     description: "Allow pre-releases"
diff --git a/packed/index.js b/packed/index.js
index d5062eb..d3dce68 100644
--- a/packed/index.js
+++ b/packed/index.js
@@ -101,9 +101,8 @@ async function convert_git_branch_tag_to_hash(branch_tag) {
     return git_hash;
 }
 async function echo_command_and_execute(command, directory) {
- await core.group(`Executing "${command}`, async () => {
- child_process.execSync(command, { stdio: "inherit", cwd: directory });
- });
+ core.info(`Executing "${command}`);
+ child_process.execSync(command, { stdio: "inherit", cwd: directory });
 }
 async function checkout_sdl_git_hash(branch_tag_hash, directory) {
     fs.mkdirSync(directory, { recursive: true });
@@ -393,6 +392,10 @@ function parse_requested_sdl_version(version_request) {
     const LATEST_SUFFIX = "-latest";
     let version;
     let version_type;
+ version_request = version_request.toLowerCase();
+ if (version_request.startsWith("sdl")) {
+ version_request = version_request.substring(3);
+ }
     try {
         if (version_request.endsWith(HEAD_SUFFIX)) {
             version_type = SdlReleaseType.Head;
diff --git a/src/main.ts b/src/main.ts
index 506625b..ef18aac 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -69,9 +69,8 @@ async function convert_git_branch_tag_to_hash(
 }
 
 async function echo_command_and_execute(command: string, directory: string) {
- await core.group(`Executing "${command}`, async () => {
- child_process.execSync(command, { stdio: "inherit", cwd: directory });
- });
+ core.info(`Executing "${command}`);
+ child_process.execSync(command, { stdio: "inherit", cwd: directory });
 }
 
 async function checkout_sdl_git_hash(
diff --git a/src/version.ts b/src/version.ts
index 3d1c0fe..8b0a6a6 100644
--- a/src/version.ts
+++ b/src/version.ts
@@ -172,6 +172,10 @@ export function parse_requested_sdl_version(
   const LATEST_SUFFIX = "-latest";
   let version: SdlVersion;
   let version_type: SdlReleaseType;
+ version_request = version_request.toLowerCase();
+ if (version_request.startsWith("sdl")) {
+ version_request = version_request.substring(3);
+ }
   try {
     if (version_request.endsWith(HEAD_SUFFIX)) {
       version_type = SdlReleaseType.Head;

```
