sidecar icon indicating copy to clipboard operation
sidecar copied to clipboard

Replace spaces with - in prefix too

Open datashaman opened this issue 2 years ago • 3 comments

Calling prefix() independently of nameWithPrefix() results in a function prefix which has spaces in it, which is not valid for a Lambda function name.

datashaman avatar Mar 25 '22 15:03 datashaman

Would be great if you added a new test case(s) for this so it doesn't break again in the future

wilsenhc avatar Mar 31 '22 19:03 wilsenhc

I had the same problem but it was because of a dot. Could you also filter out '.' besides spaces?

yoeriboven avatar May 11 '22 17:05 yoeriboven

I have an issue on my end with ACCENTS, for instance we use "Ratté" in APP_NAME.

Should we just slugify the prefix? Str::slug()

    /**
     * Used by Sidecar to differentiate between apps and environments.
     *
     * @return string
     */
    public function prefix()
    {
        return 'SC-' . Str::of(config('app.name') . '-' . Sidecar::getEnvironment())->slug() . '-';
    }

Francismori7 avatar Jul 28 '22 17:07 Francismori7

I think #30 fixes all of these issues, there were quite a few things I didn't consider w.r.t. the app name, but we should be good to go now. Thanks for the PR and the test cases! Lemme know if you hit anything else.

aarondfrancis avatar Sep 09 '22 20:09 aarondfrancis