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

devonfw / IDEasy / 18699372415

21 Oct 2025 10:22PM UTC coverage: 68.541% (+0.02%) from 68.522%
18699372415

push

github

web-flow
#1536: Disable uninstall for corepack and npm (#1541)

3469 of 5543 branches covered (62.58%)

Branch coverage included in aggregate %.

9063 of 12741 relevant lines covered (71.13%)

3.13 hits per line

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

83.33
cli/src/main/java/com/devonfw/tools/ide/tool/corepack/Corepack.java
1
package com.devonfw.tools.ide.tool.corepack;
2

3
import java.nio.file.Files;
4
import java.nio.file.Path;
5
import java.util.Set;
6

7
import com.devonfw.tools.ide.common.Tag;
8
import com.devonfw.tools.ide.context.IdeContext;
9
import com.devonfw.tools.ide.tool.ToolCommandlet;
10
import com.devonfw.tools.ide.tool.ToolInstallation;
11
import com.devonfw.tools.ide.tool.npm.NpmBasedCommandlet;
12

13
/**
14
 * {@link ToolCommandlet} for <a href="https://www.npmjs.com/package/corepack">corepack</a>.
15
 */
16
public class Corepack extends NpmBasedCommandlet {
17

18
  private static final String COREPACK_HOME_FOLDER = "corepack";
19

20
  /**
21
   * The constructor.
22
   *
23
   * @param context the {@link IdeContext}.
24
   */
25
  public Corepack(IdeContext context) {
26

27
    super(context, "corepack", Set.of(Tag.JAVA_SCRIPT, Tag.BUILD));
7✔
28
  }
1✔
29

30
  @Override
31
  protected boolean canBeUninstalled() {
32
    return false;
2✔
33
  }
34

35
  @Override
36
  public String getToolHelpArguments() {
37

38
    return "help";
×
39
  }
40

41
  @Override
42
  protected Path getToolHomePath(ToolInstallation toolInstallation) {
43
    return getOrCreateCorepackHomeFolder();
3✔
44
  }
45

46
  /**
47
   * @return the {@link Path} to the corepack home folder, creates the folder if it was not existing.
48
   */
49
  public Path getOrCreateCorepackHomeFolder() {
50
    Path confPath = this.context.getConfPath();
4✔
51
    Path corepackConfigFolder = confPath.resolve(COREPACK_HOME_FOLDER);
4✔
52
    if (!Files.isDirectory(corepackConfigFolder)) {
5!
53
      this.context.getFileAccess().mkdirs(corepackConfigFolder);
5✔
54
    }
55
    return corepackConfigFolder;
2✔
56
  }
57
}
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

© 2026 Coveralls, Inc