setCurrentWorkingDirectory
Changes the current working directory.
Example
ts
import { setCurrentWorkingDirectory } from "@duplojs/server-utils";
import { E } from "@duplojs/utils";
const result = setCurrentWorkingDirectory("/tmp/project");
// result: E.Fail | E.Ok
if (E.isRight(result)) {
// the action was successful
}Syntax
typescript
function setCurrentWorkingDirectory(
path: string
): E.Fail | E.OkParameters
path(string) : target path.
Return value
E.Ok: if the directory change succeeded.E.Fail: if the directory change failed.
See also
getCurrentWorkDirectory- Returns the current working directory.getProcessArguments- Returns command-line arguments.environmentVariable- Loads and validates environment variables.
