Add background mount path helpers

This commit is contained in:
Jan Bader
2026-07-19 19:48:49 +02:00
parent ef8caef37b
commit 7edd1b8d7f
5 changed files with 227 additions and 12 deletions
+22 -7
View File
@@ -16,6 +16,7 @@ type config struct {
PasswordCommandArgs []string
User string
DocspellURL string
MountPath string
ArchiveDirectory string
ImportDirectories []string
}
@@ -36,13 +37,6 @@ type DocspellItem struct {
}
func main() {
fmt.Println("##################### START #####################")
fmt.Println(" Docspell Import - v0.3")
fmt.Println(" by jacob1123")
fmt.Println(" (based on work by totti4ever) ")
fmt.Println("#################################################")
fmt.Println()
cfg, password := loadConfigAndPassword()
if len(os.Args) > 1 && os.Args[1] == "mount" {
@@ -52,6 +46,27 @@ func main() {
}
return
}
if len(os.Args) > 1 && os.Args[1] == "get-local-path" {
if err := runGetLocalPathCommand(os.Args[2:], cfg, password); err != nil {
fmt.Fprintln(os.Stderr, "get-local-path failed:", err)
os.Exit(1)
}
return
}
if len(os.Args) > 1 && os.Args[1] == "get-url" {
if err := runGetURLCommand(os.Args[2:], cfg, password); err != nil {
fmt.Fprintln(os.Stderr, "get-url failed:", err)
os.Exit(1)
}
return
}
fmt.Println("##################### START #####################")
fmt.Println(" Docspell Import - v0.3")
fmt.Println(" by jacob1123")
fmt.Println(" (based on work by totti4ever) ")
fmt.Println("#################################################")
fmt.Println()
runImportCommand(cfg, password, os.Args[1:])
}