Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Add support for glob patterns in single quotes for files and exclude arguments #1679

Merged
merged 4 commits into from
Nov 10, 2016

Conversation

IllusionMH
Copy link
Contributor

PR checklist

What changes did you make?

There were three ways to pass globs in npm scripts were mentioned in #1639:

  1. Without quotes src/**/*.ts
      - works on Windows (src/**/*.ts is passed to process and matching is done with glob module)
      - doesn't match all files on Linux (see Normalize glob matching between Linux and Windows during TSLint build. Fix lint error. #1678)

  2. With single quotes 'src/**/*.ts'

  • works on Linux (src/**/*.ts is passed to process and matched with glob module)
  • doesn't match anything on Windows since process receives quotes string as argument 'src/**/*.ts' and glob returns no matches with quotes
  1. With double quotes "src/**/*.ts"
  • works both on Windows and Linux (src/**/*.ts is passed to process and matching is done with glob module)
      - requires escaping in package.json file (e.g. "lint": "tslint \"src/**/*.ts\"") which hurts readability and might lead to errors if code editor doesn't notify about errors immediately

First case is OS specific and can't be addressed in TSLint package, but second might be properly handled.

This PR simply clears single quotes that may appear on Windows platform if glob is wrapped in single quotes in npm script.
Main intent is to increase interoperability between platforms and make npm scripts easy to write/read.

@IllusionMH IllusionMH changed the title Single quoted globs Add support for glob patterns in single quotes for files and exclude arguments Nov 4, 2016
@nchen63 nchen63 merged commit ebbce9c into palantir:master Nov 10, 2016
@nchen63
Copy link
Contributor

nchen63 commented Nov 10, 2016

@IllusionMH thanks!

@IllusionMH IllusionMH deleted the single-quoted-globs branch January 8, 2017 12:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants