Class NodeCommand
java.lang.Object
com.brunoritz.gradle.singularnode.platform.NodeCommand
Utility to create NodeJS invocations. This class provides means of setting the execution environment and providing
any arguments necessary. The commands are executed using th calling project's directory as its working directory.
-
Constructor Summary
ConstructorsConstructorDescriptionNodeCommand(org.gradle.process.ExecOperations processes, File workingDirectory, InstallationLayout layout) -
Method Summary
Modifier and TypeMethodDescriptionargs(io.vavr.collection.List<CharSequence> args) Appends the given arguments to the potentially existing ones.args(CharSequence... args) Appends the given arguments to the potentially existing ones.voidexecute()Executes the configured command.withEnvironment(io.vavr.collection.Map<CharSequence, CharSequence> environment) Appends environment variables to the command.
-
Constructor Details
-
NodeCommand
public NodeCommand(org.gradle.process.ExecOperations processes, File workingDirectory, InstallationLayout layout)
-
-
Method Details
-
args
Appends the given arguments to the potentially existing ones. No existing parameters will be overwritten.- Parameters:
args- The additional arguments- Returns:
- A new instance with the updated arguments
-
args
Appends the given arguments to the potentially existing ones. No existing parameters will be overwritten.- Parameters:
args- The additional arguments- Returns:
- A new instance with the updated arguments
-
withEnvironment
Appends environment variables to the command. Existing environment variables will be overwritten with those contained inenvironment.- Parameters:
environment- The additional environment to apply- Returns:
- A new instance with the updated environment
-
execute
public void execute()Executes the configured command. In order to make the NodeJS invocation work properly, thePATHenvioronemnt variable is prepended with the binary directory of the NodeJS installation.
-