Skip to content

fix(rename): only strip 'Loki-' prefix when hyphen separator present#30

Open
royosherove wants to merge 1 commit intomainfrom
fix/loki-prefix-strip-only-hyphen
Open

fix(rename): only strip 'Loki-' prefix when hyphen separator present#30
royosherove wants to merge 1 commit intomainfrom
fix/loki-prefix-strip-only-hyphen

Conversation

@royosherove
Copy link
Copy Markdown
Member

Addresses Codex P2 on #29 (post-merge follow-up): #29 (review)

#29 broadened _account_already_prefixed to match any case-insensitive loki* name, but the first-install SSM write path still blindly did ${current_name:5} to derive /loki/original-account-name. For names like loki1-MyAccount or LokiDev-SomeAccount, that produced corrupt values (-MyAccount, ev-SomeAccount).

Only strip when the lowercase 5-char prefix is exactly loki-; otherwise fall back to ACCOUNT_ID, matching the existing empty-result fallback.

#29 broadened _account_already_prefixed to match any 'loki*' name
(case-insensitive) to cover names like 'LOKI-Foo', but the first-install
SSM write path still blindly did ${current_name:5} to derive the stored
/loki/original-account-name. For names like 'loki1-MyAccount' or
'LokiDev-SomeAccount' that produced corrupt values ('-MyAccount',
'ev-SomeAccount').

Only strip when the lowercase 5-char prefix is exactly 'loki-'; otherwise
fall back to ACCOUNT_ID, matching the existing fallback for empty results.

Addresses Codex P2 on PR #29 (post-merge follow-up).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant