• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

devonfw / IDEasy / 12429379558

20 Dec 2024 10:01AM UTC coverage: 67.345% (-0.1%) from 67.478%
12429379558

Pull #903

github

web-flow
Merge d3d2a74f1 into bc0d144fa
Pull Request #903: #898 improved feedback messages

2576 of 4174 branches covered (61.72%)

Branch coverage included in aggregate %.

6659 of 9539 relevant lines covered (69.81%)

3.07 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

31.58
cli/src/main/java/com/devonfw/tools/ide/commandlet/UninstallPluginCommandlet.java
1
package com.devonfw.tools.ide.commandlet;
2

3
import com.devonfw.tools.ide.context.IdeContext;
4
import com.devonfw.tools.ide.property.PluginProperty;
5
import com.devonfw.tools.ide.property.ToolProperty;
6
import com.devonfw.tools.ide.tool.ToolCommandlet;
7
import com.devonfw.tools.ide.tool.plugin.PluginBasedCommandlet;
8

9
/**
10
 * {@link Commandlet} to install a tool.
11
 *
12
 * @see ToolCommandlet#install()
13
 */
14
public class UninstallPluginCommandlet extends Commandlet {
15

16
  /** The tool to install. */
17
  public final ToolProperty tool;
18

19
  /** The optional version to set and install. */
20
  public final PluginProperty plugin;
21

22
  /**
23
   * The constructor.
24
   *
25
   * @param context the {@link IdeContext}.
26
   */
27
  public UninstallPluginCommandlet(IdeContext context) {
28

29
    super(context);
3✔
30
    addKeyword(getName());
4✔
31
    this.tool = add(new ToolProperty("", true, "tool"));
11✔
32
    this.plugin = add(new PluginProperty("", true, "plugin"));
11✔
33
  }
1✔
34

35
  @Override
36
  public String getName() {
37

38
    return "uninstall-plugin";
2✔
39
  }
40

41
  @Override
42
  public void run() {
43
    ToolCommandlet commandlet = this.tool.getValue();
×
44
    String plugin = this.plugin.getValue();
×
45

46
    if (commandlet instanceof PluginBasedCommandlet cmd) {
×
47
      if (cmd.uninstallPlugin(cmd.getPlugin(plugin)) == 0) {
×
48
        context.info("Successfully uninstalled plugin " + plugin);
×
49
      } else {
50
        context.error("Could not uninstall plugin " + plugin + " because we could not find an installation");
×
51
      }
52
    } else {
53
      context.warning("Tool {} does not support plugins.", tool.getName());
×
54
    }
55
  }
×
56

57
  @Override
58
  public ToolCommandlet getToolForCompletion() {
59
    return this.tool.getValue();
×
60
  }
61
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc