19 Commits
Author SHA1 Message Date
bartal-lsn d247095e87 fix(drive cli)!: delete remote flag changed 2026-08-28 14:08:58 +01:00
bartal-lsn 66579d068d webm 2026-08-28 01:14:26 +01:00
bartal-lsn 4c14ef2cee webm 2026-08-28 01:10:37 +01:00
bartal-lsn 0f94e50746 webm 2026-08-28 01:07:41 +01:00
bartal-lsn c9aa028b3c webm 2026-08-28 01:01:49 +01:00
bartal-lsn bca125cb92 Update README.md 2026-08-28 00:50:13 +01:00
bartal-lsn 7d73901631 Update README.md 2026-08-28 00:49:26 +01:00
bartal-lsn 6663cb25f8 webm 2026-08-28 00:42:23 +01:00
bartal-lsn 8a28364839 Update README.md 2026-08-28 00:38:34 +01:00
bartal-lsn 894f97820e webm 2026-08-28 00:37:43 +01:00
bartal-lsn fb646a94be Update README.md 2026-08-28 00:32:49 +01:00
bartal-lsn 4bcae1358d Update README.md 2026-08-28 00:32:33 +01:00
bartal-lsn 2428a33046 Update README.md 2026-08-28 00:31:40 +01:00
bartal-lsn a48fe55d4b Update README.md 2026-08-28 00:29:47 +01:00
bartal-lsn 0df346dbf9 Update README.md 2026-08-28 00:29:18 +01:00
bartal-lsn d7f4c6826b Update README.md 2026-08-28 00:27:34 +01:00
bartal-lsn 79be211df3 test 2026-08-28 00:26:00 +01:00
bartal-lsn ba87d6184b test webm 2026-08-28 00:24:20 +01:00
bartal-lsn 180c3f0eba test webm 2026-08-28 00:19:24 +01:00
4 changed files with 19 additions and 11 deletions
+2
View File
@@ -2,6 +2,8 @@
Generate markdown documentation from directory structure. Optimized for LLM ingestion.
<video src="./docs/videos/dirmd.webm" autoplay loop muted playsinline></video>
## Features
- Recursive directory traversal
Binary file not shown.
Binary file not shown.
+17 -11
View File
@@ -30,7 +30,6 @@ func CheckAuth() error {
return nil
}
// EnsureRemoteParent creates the parent remote directory if it doesn't exist.
func EnsureRemoteParent(remoteDir string) error {
binary, err := Lookup()
if err != nil {
@@ -38,37 +37,45 @@ func EnsureRemoteParent(remoteDir string) error {
}
parentDir := filepath.Dir(remoteDir)
// Try create-folder on the grandparent for the parent
grandparent := filepath.Dir(parentDir)
parentName := filepath.Base(parentDir)
cmd := exec.Command(binary, "filesystem", "create-folder", grandparent, parentName)
cmd.Stdout = nil
cmd.Stderr = nil
cmd.Run() // Ignore errors — folder may already exist
cmd.Run()
return nil
}
// UploadDir uploads an entire local directory to Proton Drive.
// The local directory's basename becomes the remote directory name.
func CleanRemote(remoteDir string) {
binary, err := Lookup()
if err != nil {
return
}
cmd := exec.Command(binary, "filesystem", "delete", remoteDir)
cmd.Stdout = nil
cmd.Stderr = nil
cmd.Run()
}
func UploadDir(localDir, remoteDir string) error {
binary, err := Lookup()
if err != nil {
return fmt.Errorf("proton-drive not found in PATH: %w", err)
}
// Ensure parent of remote dir exists
if err := EnsureRemoteParent(remoteDir); err != nil {
return fmt.Errorf("cannot prepare remote directory: %w", err)
}
// Upload to parent — the local dir's basename creates the remote dir
CleanRemote(remoteDir)
remoteParent := filepath.Dir(remoteDir)
cmd := exec.Command(binary, "filesystem", "upload", localDir, remoteParent,
"--conflict-strategy", "replace")
"--folder-conflict-strategy", "replace", "--file-conflict-strategy", "replace")
var stderr strings.Builder
cmd.Stderr = &stderr
@@ -80,7 +87,6 @@ func UploadDir(localDir, remoteDir string) error {
return nil
}
// Upload uploads a single local file to a remote path on Proton Drive.
func Upload(localPath, remotePath string) error {
binary, err := Lookup()
if err != nil {
@@ -111,7 +117,7 @@ func Upload(localPath, remotePath string) error {
func runUpload(binary, localPath, remoteDir string) error {
cmd := exec.Command(binary, "filesystem", "upload", localPath, remoteDir,
"--conflict-strategy", "replace")
"--folder-conflict-strategy", "replace", "--file-conflict-strategy", "replace")
var stderr strings.Builder
cmd.Stderr = &stderr