Commit f67ad7b
authored
feat: add cp command for file copy to/from instances (#18)
* feat: add cp command for file copy operations
Add 'hypeman cp' command for copying files to/from running instances,
with docker cp compatible semantics:
Features:
- Copy files and directories to instances: hypeman cp file.txt instance:/path
- Copy from instances: hypeman cp instance:/path file.txt
- STDIN/STDOUT streaming with '-' argument for tar archives
- Recursive directory copying with proper tar packing/unpacking
- Symlink handling with --follow-links flag
- Archive mode (-a) to preserve UID/GID ownership
- Quiet mode (-q) to suppress progress output
- Docker cp path resolution semantics:
- SRC_PATH/. copies contents, not the directory itself
- Trailing slash handling for directory vs file detection
The command communicates with the API server via WebSocket,
streaming file data as binary chunks with JSON metadata headers.
* chore: update hypeman-go dependency
Update to e893d90 with circular symlink detection and root ownership fix.
* fix(cp): implement copyContentsOnly for from-instance operations
When copying a directory from instance to local, the /. suffix
(copy contents only) was computed but not used. Now:
- Without /.: creates source directory inside destination (docker cp semantics)
- With /.: copies contents directly into destination
* chore: update hypeman-go to v0.8.0 and remove replace directive
Update to official v0.8.0 release which adds the file copy SDK functions
(CpToInstance, CpFromInstance).1 parent 1661f08 commit f67ad7b
4 files changed
+994
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
109 | | - | |
| 108 | + | |
| 109 | + | |
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
| |||
0 commit comments