sidecar
sidecar copied to clipboard
Replace spaces with - in prefix too
Calling prefix() independently of nameWithPrefix() results in a function prefix which has spaces in it, which is not valid for a Lambda function name.
Would be great if you added a new test case(s) for this so it doesn't break again in the future
I had the same problem but it was because of a dot. Could you also filter out '.' besides spaces?
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() . '-';
}
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.