shelljs / shelljs/shelljs

Having trouble properly implementing ShellJS

Open
#1,107 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
JavaScript
Stars
14.4k
Forks
756
PR merge metrics
No merged PRs in 30d

Description

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!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the ShellJS documentation and the exec call shown in the issue, focusing on how the Unix find command is invoked from a NodeJS app. Determine whether ShellJS documents a cross-platform equivalent or whether the requested behavior needs a separate approach; done means the file lookup works on Windows as well as Mac and Linux.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs, shell
Domain
cli, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.