Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

filemanager-webpack-plugin

Package Overview
Dependencies
Maintainers
1
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

filemanager-webpack-plugin - npm Package Compare versions

Comparing version 1.0.15 to 1.0.16

37

lib/index.js

@@ -13,2 +13,3 @@ 'use strict';

var fs = require('fs');
var fsExtra = require('fs-extra');
var rimraf = require('rimraf');

@@ -85,2 +86,6 @@ var mv = require('mv');

if (this.options.verbose) {
console.log(' - FileManagerPlugin: Start copy source file: ' + source + ' to destination file: ' + destination);
}
cpx.copy(source, destination, this.cpxOptions, function (err) {

@@ -93,3 +98,3 @@ if (err && _this2.options.verbose) {

if (_this2.options.verbose) {
console.log(' - FileManagerPlugin: Finished copy source: ' + sourceDir + ' to destination: ' + command.destination);
console.log(' - FileManagerPlugin: Finished copy source: ' + source + ' to destination: ' + destination);
}

@@ -139,20 +144,18 @@

if (_this3.options.verbose) {
console.log(' - FileManagerPlugin: Start copy source: ' + sourceDir + ' to destination: ' + command.destination);
}
if (stats.isFile()) {
fs.copyFile(command.source, command.destination, function (err) {
if (err && _this3.options.verbose) {
console.log(' - FileManagerPlugin: Start copy source file: ' + command.source + ' to destination file: ' + command.destination);
}
resolve(err);
if (_this3.options.verbose) {
console.log(' - FileManagerPlugin: Start copy source: ' + command.source + ' to destination: ' + command.destination);
}
fsExtra.copy(command.source, command.destination, function (err) {
if (err) reject(err);
resolve();
});
} else {
var _sourceDir = command.source;
_sourceDir += (_sourceDir.substr(-1) !== "/" ? "/" : "") + "**/*";
_this3.copyDirectory(_sourceDir, command.destination, resolve, reject);
var sourceDir = command.source + (command.source.substr(-1) !== "/" ? "/" : "") + "**/*";
_this3.copyDirectory(sourceDir, command.destination, resolve, reject);
}

@@ -198,4 +201,6 @@ });

mv(command.source, command.destination, { mkdirp: _this3.options.moveWithMkdirp }, function (err) {
if (err && _this3.options.verbose) {
console.log(' - FileManagerPlugin: Error - move failed', err);
if (err) {
if (_this3.options.verbose) {
console.log(' - FileManagerPlugin: Error - move failed', err);
}
reject(err);

@@ -202,0 +207,0 @@ }

{
"name": "filemanager-webpack-plugin",
"version": "1.0.15",
"version": "1.0.16",
"description": "This Webpack plugin allows you to copy, move, delete files and directories before and after builds",

@@ -42,2 +42,3 @@ "main": "lib/index.js",

"cpx": "^1.5.0",
"fs-extra": "^4.0.3",
"make-dir": "^1.1.0",

@@ -44,0 +45,0 @@ "mv": "^2.1.1",

const cpx = require('cpx');
const fs = require('fs');
const fsExtra = require('fs-extra')
const rimraf = require('rimraf');

@@ -69,2 +70,6 @@ const mv = require('mv');

if (this.options.verbose) {
console.log(` - FileManagerPlugin: Start copy source file: ${source} to destination file: ${destination}`);
}
cpx.copy(source, destination, this.cpxOptions, (err) => {

@@ -77,3 +82,3 @@ if (err && this.options.verbose) {

if (this.options.verbose) {
console.log(` - FileManagerPlugin: Finished copy source: ${sourceDir} to destination: ${command.destination}`)
console.log(` - FileManagerPlugin: Finished copy source: ${source} to destination: ${destination}`)
}

@@ -121,13 +126,15 @@

if (this.options.verbose) {
console.log(` - FileManagerPlugin: Start copy source: ${sourceDir} to destination: ${command.destination}`)
}
if(stats.isFile()) {
fs.copyFile(command.source, command.destination, (err) => {
if (err && this.options.verbose) {
console.log(` - FileManagerPlugin: Start copy source file: ${command.source} to destination file: ${command.destination}`)
}
resolve(err)
if (this.options.verbose) {
console.log(` - FileManagerPlugin: Start copy source: ${command.source} to destination: ${command.destination}`);
}
fsExtra.copy(command.source, command.destination, (err) => {
if (err)
reject(err);
resolve();
});

@@ -137,5 +144,3 @@

let sourceDir = command.source;
sourceDir += ((sourceDir.substr(-1) !== "/") ? "/" : "") + "**/*";
const sourceDir = command.source + ((command.source.substr(-1) !== "/") ? "/" : "") + "**/*";
this.copyDirectory(sourceDir, command.destination, resolve, reject);

@@ -176,8 +181,10 @@

if (this.options.verbose) {
console.log(` - FileManagerPlugin: Start move source: ${command.source} to destination: ${command.destination}`)
console.log(` - FileManagerPlugin: Start move source: ${command.source} to destination: ${command.destination}`);
}
mv(command.source, command.destination, { mkdirp: this.options.moveWithMkdirp }, (err) => {
if (err && this.options.verbose) {
console.log(' - FileManagerPlugin: Error - move failed', err);
if (err) {
if(this.options.verbose) {
console.log(' - FileManagerPlugin: Error - move failed', err);
}
reject(err);

@@ -187,3 +194,3 @@ }

if (this.options.verbose) {
console.log(` - FileManagerPlugin: Finished move source: ${command.source} to destination: ${command.destination}`)
console.log(` - FileManagerPlugin: Finished move source: ${command.source} to destination: ${command.destination}`);
}

@@ -190,0 +197,0 @@

@@ -25,3 +25,5 @@ const path = require('path');

{ source: "./dist", destination: "./testing2" },
{ source: "./dist/bundle.js", destination: "./newfile.js" }
{ source: "./dist/bundle.js", destination: "./newfile.js" },
{ source: "./dist/bundle.js", destination: "./newfile2.js" },
{ source: "./dist/bundle.js", destination: "./newfile3.js" }
],

@@ -28,0 +30,0 @@ }

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc