Closed maol74 closed 9 years ago
Thanks for the report, although I can't immediately see from the code where this is happening. The unzipping certainly does overwrite any files that already exist, basically on the assumption that you're always creating a new project from a template. Is that the specific issue you're seeing? Or does lazybones create ...
actually delete all content from the target directory?
Thanks for the answer: It removed all directories, or as it seems, only if there are any directories that the new templates doesn´t also have. You can easy reproduce this by running:
I followed these instructions but couldn't reproduce the issue with either v0.7 or 0.8.1. What version are you using? And which platform? Perhaps it's platform-specific for some reason.
It's is not a problem with lazybones. But the afterburnfx template moves everything under src/main/java
to the specified package appending the projectname to each file. Including the old package from the previous create.
Before:
└✪ tree afp/
afp/
├── build.gradle
├── gradle
│ ├── javafx.gradle
│ └── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
├── pom.xml
├── README.md
└── src
└── main
├── java
│ └── org
│ └── example
│ ├── AfpMain.java
│ ├── AfpPresenter.java
│ ├── AfpService.java
│ ├── AfpView.java
│ └── MyClass.java
└── resources
└── org
└── example
└── afp.fxml
After the second create with example
as package:
└✪ tree afp/
afp/
├── build.gradle
├── gradle
│ ├── javafx.gradle
│ └── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
├── pom.xml
├── README.md
└── src
└── main
├── java
│ └── example
│ ├── AfpMain.java
│ ├── Afporg
│ │ └── example
│ │ ├── AfpMain.java
│ │ ├── AfpPresenter.java
│ │ ├── AfpService.java
│ │ ├── AfpView.java
│ │ └── MyClass.java
│ ├── AfpPresenter.java
│ ├── AfpService.java
│ └── AfpView.java
└── resources
├── example
│ └── afp.fxml
└── org
└── example
└── afp.fxml
Alright, it's the afterburnfx doing this then, sorry pledbrook for wasting your time and thanks ancho!
When running
lazybones create
it removes all content in target directory which is really dangerous (if you by accident run it again when you have added a lot of more code to the project). Would be nice, and less error prone, to just overwrite or even better get a confirm prompt for each overwrite.