-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Upload path resolves relative to binary location instead of working directory #637
Copy link
Copy link
Open
Description
Problem
When using --upload, the path is resolved relative to the binary's location (std::env::current_exe()) rather than the current working directory. This makes it impossible to upload files unless they happen to be in the same directory as the gws binary (typically /usr/local/bin/).
Steps to reproduce
# From any directory
echo "test" > /tmp/test.png
gws drive files create --upload /tmp/test.png --json '{"name":"test.png","mimeType":"image/png"}'Error:
--upload '/tmp/test.png' resolves to '/private/tmp/test.png' which is outside the current directory
Even absolute paths fail:
gws drive files create --upload /Users/me/documents/photo.png --json '{"name":"photo.png"}'
# Error: outside the current directoryThe "current directory" in the error message is actually the binary's parent directory (/usr/local/bin/), not the shell's working directory.
Expected behavior
--upload should accept:
- Absolute paths to any readable file
- Relative paths resolved from the shell's current working directory (
std::env::current_dir())
Current workaround
Copying the gws binary to a writable directory and placing upload files next to it, but not practical for team use.
Environment
- gws 0.18.1
- macOS (Apple Silicon)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels