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

node-mv

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-mv - npm Package Compare versions

Comparing version 0.0.3 to 0.0.6

3

bin/mv.js

@@ -31,4 +31,2 @@ #!/usr/bin/env node

console.log('Start renaming');
mv.mvFile(currentDir, sourceAbsPath, destAbsPath, function(err) {

@@ -39,4 +37,3 @@ if (err) {

console.log('Successfully moved file and updated all file references');
process.exit();
})

14

index.js

@@ -35,2 +35,3 @@ var path = require('path'),

var matches = data.match(re);
console.log(matches)

@@ -44,3 +45,3 @@ if (matches) {

var newRelativePath = path.relative(path.dirname(destAbsPath), oldAsbPath);
if (newRelativePath.indexOf(".") < 0 ) {
if (newRelativePath.indexOf(".") != 0 ) {
newRelativePath = './' + newRelativePath;

@@ -58,13 +59,12 @@ }

var fileMatchingStr = exports.getFileMatchingStr();
glob(fileMatchingStr, {cwd:currentDir}, function(err, files) {
if (err) return cb(err);
function updateReferenceForFile(file) {
var oldRelativePath = path.relative(path.dirname(file), sourceAbsPath).replace(/\.(js|coffee)$/g, ''),
newRelativePath = path.relative(path.dirname(file), destAbsPath).replace(/\.(js|coffee)$/g, '');
if (oldRelativePath.indexOf(".") < 0 ) {
function updateReferenceForFile(file, cb) {
var oldRelativePath = path.relative(path.dirname(file), sourceAbsPath).replace(/\.(js|coffee)$/, ''),
newRelativePath = path.relative(path.dirname(file), destAbsPath).replace(/\.(js|coffee)$/, '');
if (oldRelativePath.indexOf(".") != 0 ) {
oldRelativePath = './' + oldRelativePath;
}
if (newRelativePath.indexOf(".") < 0 ) {
if (newRelativePath.indexOf(".") != 0 ) {
newRelativePath = './' + newRelativePath;

@@ -71,0 +71,0 @@ }

{
"name": "node-mv",
"version": "0.0.3",
"version": "0.0.6",
"description": "Command-line tool for renaming/moving a node.js source file and update all references to the file",

@@ -15,3 +15,3 @@ "main": "index.js",

"bin": {
"node-mv": "mv.js"
"node-mv": "./bin/mv.js"
},

@@ -18,0 +18,0 @@ "directories": {

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