Package org.machanism.machai.cli
Class CleanCommand
java.lang.Object
org.machanism.machai.cli.CleanCommand
Provides shell commands for cleaning up Machai temporary folders.
The CleanCommand class includes methods for removing all
".machai" template folders within a specified root directory.
Usage Example:
CleanCommand cleanCmd = new CleanCommand();
cleanCmd.clean(new File("/path/to/root"));
- Since:
- 0.0.2
- Author:
- Viktor Tovstyi
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidRemoves all ".machai" template folders from the provided root directory.static voidremoveAllDirectoriesByName(Path rootPath, String dirName) Removes all directories with the specified name from the given root path.
-
Field Details
-
MACHAI_TEMP_DIR
-
-
Constructor Details
-
CleanCommand
public CleanCommand()
-
-
Method Details
-
clean
@ShellMethod("Removes all .machai template folders from the root directory.") public void clean(@ShellOption(help="The path fo the project directory.",defaultValue="__NULL__",value="dir") File dir) throws IOException Removes all ".machai" template folders from the provided root directory.- Parameters:
dir- The path to the project directory. If null, uses the user directory.- Throws:
IOException- if the cleanup process fails
-
removeAllDirectoriesByName
Removes all directories with the specified name from the given root path.- Parameters:
rootPath- The root directory to start the search.dirName- The name of directories to remove.- Throws:
IOException- If an I/O error occurs.
-