diff options
| author | Nikolaus Gotsche <n@softwarefools.com> | 2018-11-02 13:03:42 +0100 |
|---|---|---|
| committer | Nikolaus Gotsche <n@softwarefools.com> | 2018-11-02 13:03:42 +0100 |
| commit | 38cd567117fb2248a175f23cb8a736a988e3691c (patch) | |
| tree | d9bba5d41b9c6126c5fa249b9175d1486d8d4ddd /interact.go | |
| parent | 2a50cbb5ffd3f4fbc088bd18598980e0f142d7b7 (diff) | |
Full working import/export with TARing of the files
Diffstat (limited to 'interact.go')
| -rw-r--r-- | interact.go | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/interact.go b/interact.go index c9b96e6..28c61a0 100644 --- a/interact.go +++ b/interact.go @@ -515,23 +515,26 @@ func interact(fulldb bool) { c.Println("Customers:",len(cus)) //c.Println("Customers:",cus) if isInterSure("Export ?"){ - ExportCustomers(cus,"export.customers") - ExportProjects(prs,"export.projects") - ExportTasks(tas,"export.tasks") + ExportCustomers(cus) + ExportProjects(prs) + ExportTasks(tas) + TarExports("exports.tar") + PurgeTemps() } - icus := ImportCustomers("export.customers") - c.Println("Imported Customers:",len(icus)) - //c.Println("Customers:",icus) - - itas := ImportTasks("export.tasks") - c.Println("Imported Tasks:",len(itas)) - //c.Println("Tasks:",itas) + if isInterSure("Import ?"){ + UnTarExports("exports.tar") + icus := ImportCustomers() + itas := ImportTasks() + iprs := ImportProjects() + PurgeTemps() + c.Println("Imported Customers:",len(icus)) + c.Println("Imported Projects:",len(iprs)) + c.Println("Imported Tasks:",len(itas)) + SaveImportsToDB(icus,iprs,itas) + } - iprs := ImportProjects("export.projects") - c.Println("Imported Projects:",len(iprs)) //c.Println("Projects:",iprs) - SaveImportsToDB(icus,iprs,itas) }, }) |
