Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(cli): generate correctly named file in DumpHandler#12409

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
mafredri merged 4 commits intomainfrommafredri/fix-dump-filename
Mar 4, 2024

Conversation

mafredri
Copy link
Member

@mafredrimafredri commentedMar 4, 2024
edited
Loading

Noticed we always write the filenames with "agent" in the name, this fixes that.

EDIT: As a bonus we dids/:/-/ on time so that files are safe on any filesystem, e.g. NTFS.
EDIT2: As a bonus2 we usetime.Now().UTC() since our formatting string appendsZ to the filename, but we were actually rendering the local time.

@mafredrimafredri changed the titlefix(cli): produce corrently named file in DumpHandlerfix(cli): generate corrently named file in DumpHandlerMar 4, 2024
@mafredrimafredri changed the titlefix(cli): generate corrently named file in DumpHandlerfix(cli): generate correctly named file in DumpHandlerMar 4, 2024
cli/root.go Outdated
@@ -992,7 +992,7 @@ func DumpHandler(ctx context.Context) {
if err != nil {
dir = os.TempDir()
}
fpath := filepath.Join(dir, fmt.Sprintf("coder-agent-%s.dump", time.Now().Format("2006-01-02T15:04:05.000Z")))
fpath := filepath.Join(dir, fmt.Sprintf("coder-%s-%s.dump", name, time.Now().Format("2006-01-02T15:04:05.000Z")))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

out of scope: we should probably not use colons in the file path as that's a forbidden character in NTFS.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Good catch, it's such a small change I could piggy back it on this one.

@mafredrimafredri merged commit4ce1448 intomainMar 4, 2024
@mafredrimafredri deleted the mafredri/fix-dump-filename branchMarch 4, 2024 16:35
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsMar 4, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@johnstcnjohnstcnjohnstcn approved these changes

Assignees

@mafredrimafredri

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@mafredri@johnstcn

[8]ページ先頭

©2009-2025 Movatter.jp