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

@nowa/module-file

Package Overview
Dependencies
Maintainers
4
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nowa/module-file - npm Package Compare versions

Comparing version 0.2.2 to 0.2.3

2

index.d.ts

@@ -7,3 +7,3 @@ import { Module } from '@nowa/core';

run(): Promise<void>;
private _getFiles(filePath);
private _getFiles;
}

@@ -10,0 +10,0 @@ export declare namespace ModuleFile {

@@ -56,4 +56,4 @@ "use strict";

const target = path_1.resolve(context, action.to);
const isDir = action.to.endsWith('/');
if (!isDir && files.length > 1) {
const targetIsDir = action.to.endsWith('/');
if (!targetIsDir && files.length > 1) {
logger.error(`in`, action);

@@ -63,3 +63,3 @@ logger.error(`${action.type} multiple files to a single file is not valid`);

}
if (isDir) {
if (targetIsDir) {
yield fs_extra_1.ensureDir(target);

@@ -72,5 +72,9 @@ }

yield Promise.all(files.map(file => {
const dest = isDir ? path_1.resolve(target, path_1.basename(file)) : target;
logger.debug(`copy ${file} to ${dest}`);
return fs_extra_1.copy(file, dest, { overwrite: true });
return fs_extra_1.stat(file)
.then(stat => stat.isDirectory())
.then(sourceIsDir => {
const dest = targetIsDir ? (sourceIsDir ? target : path_1.resolve(target, path_1.basename(file))) : target;
logger.debug(`copy ${file} to ${dest}`);
return fs_extra_1.copy(file, dest, { overwrite: true });
});
}));

@@ -81,3 +85,3 @@ logger.info(`copied ${files.length} file(s) / folder(s)`);

yield Promise.all(files.map(file => {
const dest = isDir ? path_1.resolve(target, path_1.basename(file)) : target;
const dest = targetIsDir ? path_1.resolve(target, path_1.basename(file)) : target;
logger.debug(`copy ${file} to ${dest}`);

@@ -84,0 +88,0 @@ return fs_extra_1.move(file, dest, { overwrite: true });

{
"name": "@nowa/module-file",
"version": "0.2.2",
"version": "0.2.3",
"description": "the nowa file module",

@@ -5,0 +5,0 @@ "scripts": {

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