Make copy ship more better
This commit is contained in:
@@ -76,7 +76,8 @@ func main() {
|
||||
planFileDst := filepath.Join(avorionRoaming, "ships", "plans", file.Name()+".plan.xml")
|
||||
turretFileDst := filepath.Join(avorionRoaming, "ships", "turrets", file.Name()+".turret.xml")
|
||||
|
||||
if FileExists(shipFileSrc) {
|
||||
if FileExists(shipFileSrc) && !FileExists(shipFileDst) {
|
||||
log.Printf("Copying '%s' to '%s'", shipFileSrc, shipFileDst)
|
||||
err := Copy(shipFileSrc, shipFileDst)
|
||||
if err != nil {
|
||||
Error.Printf("Error copying '%s' to '%s': '%v'", shipFileSrc, shipFileDst, err)
|
||||
@@ -84,7 +85,8 @@ func main() {
|
||||
}
|
||||
}
|
||||
|
||||
if FileExists(planFileSrc) {
|
||||
if FileExists(planFileSrc) && !FileExists(planFileDst) {
|
||||
log.Printf("Copying '%s' to '%s'", planFileSrc, planFileDst)
|
||||
err := Copy(planFileSrc, planFileDst)
|
||||
if err != nil {
|
||||
Error.Printf("Error copying '%s' to '%s': '%v'", planFileSrc, planFileDst, err)
|
||||
@@ -92,7 +94,8 @@ func main() {
|
||||
}
|
||||
}
|
||||
|
||||
if FileExists(turretFileSrc) {
|
||||
if FileExists(turretFileSrc) && !FileExists(turretFileDst) {
|
||||
log.Printf("Copying '%s' to '%s'", turretFileSrc, turretFileDst)
|
||||
err := Copy(turretFileSrc, turretFileDst)
|
||||
if err != nil {
|
||||
Error.Printf("Error copying '%s' to '%s': '%v'", turretFileSrc, turretFileDst, err)
|
||||
|
||||
Reference in New Issue
Block a user