ttsukagoshi / csv2gsheets

CLI tool to convert local CSV files into Google Sheets files in a designated Google Drive folder. Users can choose whether to update an existing Sheets file, or create a new one.
https://www.npmjs.com/package/csv2gsheets
MIT License
5 stars 0 forks source link

Add `ignorePatterns` property to the config option #113

Open ttsukagoshi opened 1 year ago

ttsukagoshi commented 1 year ago

Add the ignorePatterns option to c2g.config.json:

{
  // ...
  sourceDir: 'path/to/csv/files'
  ignorePatterns: [
    'file-name-to-ignore.csv', // specify a file by its file name
    '^pattern-to-ignore_\\d{8}.csv$' // or exclude files based on regular expression
  ]
}

Settings this option will exclude matching CSV files in sourceDir from the csv2gsheets process.

The pattern could be a specific file name or a JavaScript regular expression to denote a set of files. In the above example, note that the backslash in \d is escaped, i.e., \\d. Regular expressions should be written as if one is using it for the RegExp() constructor.

ttsukagoshi commented 1 year ago

Using the .gitignore-syntax would be a simplified and user-friendly approach to specify CSV files that csv2gsheets should ignore.

See