Package com.diffplug.spotless.npm
Class NpmPathResolver
- java.lang.Object
-
- com.diffplug.spotless.npm.NpmPathResolver
-
public class NpmPathResolver extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description NpmPathResolver(java.io.File explicitNpmExecutable, java.io.File explicitNodeExecutable, java.io.File explicitNpmrcFile, java.util.List<java.io.File> additionalNpmrcLocations)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.File
resolveNodeExecutable()
Finds the node executable to use.java.io.File
resolveNpmExecutable()
Finds the npm executable to use.java.lang.String
resolveNpmrcContent()
-
-
-
Method Detail
-
resolveNpmExecutable
public java.io.File resolveNpmExecutable()
Finds the npm executable to use.
Either the explicit npm executable is returned, or - if an explicit node executable is configured - tries to find the npm executable relative to the node executable. Falls back to looking for npm on the user's system usingNpmExecutableResolver
- Returns:
- the npm executable to use
- Throws:
java.lang.IllegalStateException
- if no npm executable could be found
-
resolveNodeExecutable
public java.io.File resolveNodeExecutable()
Finds the node executable to use.
Either the explicit node executable is returned, or tries to find the node executable relative to the npm executable found byresolveNpmExecutable()
.- Returns:
- the node executable to use
- Throws:
java.lang.IllegalStateException
- if no node executable could be found
-
resolveNpmrcContent
public java.lang.String resolveNpmrcContent()
-
-