From 486ed853b93048d0285b76a4a047e9ef65064f0a Mon Sep 17 00:00:00 2001 From: Marin Minnerly Date: Sat, 23 Nov 2024 19:16:32 -0800 Subject: [PATCH] Fix last analysis error --- .lune/install.luau | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/.lune/install.luau b/.lune/install.luau index afc98889..1cd65d12 100644 --- a/.lune/install.luau +++ b/.lune/install.luau @@ -3,12 +3,20 @@ local fs = require("@lune/fs") local constants = require("./lib/constants") local run = require("./lib/run") -local function toPascalCase(text: string) - return text:gsub("(.+)(%.%w+)$", function(name, ext) - return name:gsub("(%a)(%w+)", function(first, rest) - return `{first:upper()}{if rest then rest else ""}` - end):gsub("%-", "") .. ext - end) +local function toPascalCase(filename: string) + local name, ext = filename:match("(.+)(%.%w+)$") + + local function upperFirstLetter(first: string, rest: string) + return `{first:upper()}{if rest then rest else ""}` + end + + if name and ext then + name = filename:gsub("(%a)(%w+)", upperFirstLetter :: any):gsub("%-", "") + + return name .. ext + else + return filename + end end local function convertPackageNames()