Skip to content

fix(paths): expand ~ in user-provided file paths#56

Merged
steipete merged 5 commits intoopenclaw:mainfrom
salmonumbrella:fix/expand-tilde-paths
Jan 10, 2026
Merged

fix(paths): expand ~ in user-provided file paths#56
steipete merged 5 commits intoopenclaw:mainfrom
salmonumbrella:fix/expand-tilde-paths

Conversation

@salmonumbrella
Copy link
Copy Markdown
Contributor

Fixes issue where --out ~/Downloads/file.pdf (quoted) writes to literal ./~/Downloads/ instead of home directory.

Adds config.ExpandPath() and applies it to all user-provided paths (attachment download, drive upload/download, auth export/import, etc).

salmonumbrella and others added 5 commits January 10, 2026 03:15
When users specify paths with ~ (e.g., --out ~/Downloads/file.pdf) and
the path is quoted in the shell command, the tilde is not expanded by
the shell. This caused files to be written to a literal ~/Downloads
directory instead of the user's home directory.

Add config.ExpandPath() function that expands ~ at the beginning of
paths to the user's home directory. Apply this fix to all user-provided
file paths across:

- gmail attachment download (--out)
- drive download/export (--out)
- drive upload (localPath argument)
- auth token export (--out)
- auth credentials/import/keep (input paths)
- gmail thread attachments (--out-dir)
- gmail send/drafts (--attach)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add parsing for ISO 8601 datetime with numeric timezone without colon
  (e.g., 2026-01-09T16:38:41-0800), which is the format produced by
  macOS `date +%Y-%m-%dT%H:%M:%S%z`
- Add 'list' as an alias for 'events' subcommand for more intuitive CLI
  usage (gog calendar list instead of gog calendar events)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@steipete steipete force-pushed the fix/expand-tilde-paths branch from 5306b5c to e884147 Compare January 10, 2026 02:19
Copy link
Copy Markdown
Collaborator

@steipete steipete left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks! (Also added CHANGELOG entry per repo guidelines and fixed a goconst/nolintlint lint issue.)

@steipete steipete merged commit 07ffcb5 into openclaw:main Jan 10, 2026
4 checks passed
manascb1344 pushed a commit to manascb1344/gogcli that referenced this pull request Jan 15, 2026
* fix(paths): expand ~ in user-provided file paths

When users specify paths with ~ (e.g., --out ~/Downloads/file.pdf) and
the path is quoted in the shell command, the tilde is not expanded by
the shell. This caused files to be written to a literal ~/Downloads
directory instead of the user's home directory.

Add config.ExpandPath() function that expands ~ at the beginning of
paths to the user's home directory. Apply this fix to all user-provided
file paths across:

- gmail attachment download (--out)
- drive download/export (--out)
- drive upload (localPath argument)
- auth token export (--out)
- auth credentials/import/keep (input paths)
- gmail thread attachments (--out-dir)
- gmail send/drafts (--attach)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(lint): address wrapcheck and wsl issues

* fix(calendar): support ISO 8601 time format and add 'list' alias

- Add parsing for ISO 8601 datetime with numeric timezone without colon
  (e.g., 2026-01-09T16:38:41-0800), which is the format produced by
  macOS `date +%Y-%m-%dT%H:%M:%S%z`
- Add 'list' as an alias for 'events' subcommand for more intuitive CLI
  usage (gog calendar list instead of gog calendar events)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* chore(changelog): note PR openclaw#56

* chore(lint): dedupe file string

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
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.

2 participants