Skip to content

Plop actions that provides the ability to remove individual and globs of files

Notifications You must be signed in to change notification settings

TheSharpieOne/plop-pack-remove

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

plop-pack-remove

A plop action which allows you to remove individual files or many files (via glob pattern).

Installation

yarn add plop-pack-remove
npm i plop-pack-remove

Example

module.exports = function(plop) {
  // Loads the gitInit action type
  plop.load('plop-pack-remove');

  plop.setGenerator('generate', {
    prompts: [
        // ...
    ],
    actions: [{
      type: 'remove',
      path: 'some/file/path.txt',
      force: true // Allow removal of files outside of the project root. Defaults to false
      skipIfNonexistent: true // When true it will skip if the file does not exist. When false, it will throw an error. Defaults to false
    },
    {
      type: 'removeMany',
      path: 'some/directory/**',
    },
    {
      type: 'removeMany',
      path: ['some/directory/**', 'some/other/directory/**', '/tmp/outside/of/project/specific-file.txt'],
      force: true // Allow removal of files outside of the project root. Defaults to false
    }];
  })
}

About

Plop actions that provides the ability to remove individual and globs of files

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published