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 | URL
): E.Fail | E.OkParameters
path(string | URL) : target path. If aURLis provided, it is decoded to a file 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.
