initial commit: applephotos CLI with progress, cloud status, per-asset export

This commit is contained in:
Ein Anderssono
2026-06-11 20:25:07 +02:00
commit 6ec16f3966
21 changed files with 3488 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
package main
import (
"os"
"os/signal"
"syscall"
"github.com/einand/applephotos/internal/photos"
)
func main() {
sigCh := make(chan os.Signal, 1)
signal.Notify(sigCh, syscall.SIGINT, syscall.SIGTERM)
done := make(chan struct{})
var rc int
go func() {
rc = run(os.Args[1:], os.Stdout, os.Stderr, photos.DefaultBridge)
close(done)
}()
select {
case <-done:
case sig := <-sigCh:
photos.DefaultBridge.Cancel()
os.Stderr.Write([]byte("\nreceived signal, finishing current file...\n"))
<-done
_ = sig
}
os.Exit(rc)
}