Skip to content

Having trouble properly implementing ShellJS #1107

@Morsmalleo

Description

@Morsmalleo

G'day guys, I'm so sorry to bother you with such a silly question, I was wondering if anyone could help me out with properly implementing Shelljs into my project, I'm very new to shelljs and a little bit confused on the documentation of how it's implemented, basically all I want to do is allow the Unix find command and it's configuration from my NodeJS app shown below, to work cross platform with Windows... Instead of it just working on Mac & Linux

exec('find -name "' + "file.txt" + '"', { cwd: randomFolder }, (error, stdout, stderr) => {
     var filePath = stdout.substring(stdout.indexOf("./") + 2).trim("\n");
     if (error !== null) {
         console.Log("Cannot Locate the File...");
         console.log();
         return;
     }

but I don't know how to properly implement shelljs here, can anyone please help me out with how this is done, I've been trying at this for a while now!

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionQuestion from a user (which may not require code/documentation changes to the project)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions