Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#### Summary This PR introduces a new command `delete-app` to the [`boneless`](command:_github.copilot.openSymbolFromReferences?%5B%22%22%2C%5B%7B%22uri%22%3A%7B%22scheme%22%3A%22file%22%2C%22authority%22%3A%22%22%2C%22path%22%3A%22%2FUsers%2Fdavidgaspar%2FProjects%2Fgo%2Fboneless%2Fdata%2Ftest.patch%22%2C%22query%22%3A%22%22%2C%22fragment%22%3A%22%22%7D%2C%22pos%22%3A%7B%22line%22%3A0%2C%22character%22%3A17%7D%7D%5D%2C%2296d72e6a-b414-40fb-bff7-8c09cf3044eb%22%5D "Go to definition") CLI tool, allowing users to delete an existing app. The command ensures that critical components like [`app`](command:_github.copilot.openSymbolFromReferences?%5B%22%22%2C%5B%7B%22uri%22%3A%7B%22scheme%22%3A%22file%22%2C%22authority%22%3A%22%22%2C%22path%22%3A%22%2FUsers%2Fdavidgaspar%2FProjects%2Fgo%2Fboneless%2Fdata%2Ftest.patch%22%2C%22query%22%3A%22%22%2C%22fragment%22%3A%22%22%7D%2C%22pos%22%3A%7B%22line%22%3A5%2C%22character%22%3A12%7D%7D%5D%2C%2296d72e6a-b414-40fb-bff7-8c09cf3044eb%22%5D "Go to definition") and [`bff`](command:_github.copilot.openSymbolFromReferences?%5B%22%22%2C%5B%7B%22uri%22%3A%7B%22scheme%22%3A%22file%22%2C%22authority%22%3A%22%22%2C%22path%22%3A%22%2FUsers%2Fdavidgaspar%2FProjects%2Fgo%2Fboneless%2Fdata%2Ftest.patch%22%2C%22query%22%3A%22%22%2C%22fragment%22%3A%22%22%7D%2C%22pos%22%3A%7B%22line%22%3A72%2C%22character%22%3A17%7D%7D%5D%2C%2296d72e6a-b414-40fb-bff7-8c09cf3044eb%22%5D "Go to definition") cannot be deleted. #### Changes 1. **Command Addition in `main.go`:** - Added `delete-app` to the list of available commands. - Updated the help text to include the new `delete-app` command. - Implemented the `delete-app` command logic in the [`main`](command:_github.copilot.openSymbolFromReferences?%5B%22%22%2C%5B%7B%22uri%22%3A%7B%22scheme%22%3A%22file%22%2C%22authority%22%3A%22%22%2C%22path%22%3A%22%2FUsers%2Fdavidgaspar%2FProjects%2Fgo%2Fboneless%2Fdata%2Ftest.patch%22%2C%22query%22%3A%22%22%2C%22fragment%22%3A%22%22%7D%2C%22pos%22%3A%7B%22line%22%3A0%2C%22character%22%3A26%7D%7D%5D%2C%2296d72e6a-b414-40fb-bff7-8c09cf3044eb%22%5D "Go to definition") function. 2. **New File `delete.go`:** - Created a new file `delete.go` in the `internal` package. - Implemented the [`DeleteApp`] function to handle the deletion of app folders. - Added helper functions: - [`validateAppName`]: Ensures critical components cannot be deleted. - [`checkIfAppFolderExists`]: Checks if the app folder exists before attempting deletion. - [`getAppFolderPath`]: Constructs the path to the app folder based on the app name. #### Usage - **Command:** `boneless delete-app <app-name>` - **Example:** `boneless delete-app my-app` This command will delete the specified app folder if it exists and is not a critical component. #### Testing - Verified that the `delete-app` command correctly deletes existing app folders. - Ensured that attempting to delete [`app`] or [`bff`] results in an appropriate error message and no deletion occurs. - Checked that non-existent app folders produce a "not found" error message. #### Notes - This feature enhances the usability of the [`boneless`] CLI by providing a straightforward way to remove apps that are no longer needed. - Future improvements could include additional validation or confirmation prompts before deletion.
- Loading branch information