Npm script doesn't run a script that includes glob pattern

318 views Asked by At

What I have

I'm using jscodeshift library to modify some files, so I run it in npm script like so:

"scripts": {
    "build-types": "jscodeshift -t scripts/fixImportPaths.ts src/gql/**/gqlTypes/* --parser=tsx",
  }
}

but the console output thrown No files selected, nothing to do., the thing is, if I put the absolute path src/gql/specificFolder/gqlTypes/specificFile.specificExtension the script works.

What I tried

  1. Wrap the path with single quotes:
"scripts": {
    "build-types": "jscodeshift -t scripts/fixImportPaths.ts 'src/gql/**/gqlTypes/*' --parser=tsx",
  }
}
  1. Wrap the path with escaped double quotes:
"scripts": {
    "build-types": "jscodeshift -t scripts/fixImportPaths.ts \"src/gql/**/gqlTypes/*\" --parser=tsx",
  }
}

Environment

  • windows 10
  • npm 7.7.3
0

There are 0 answers