question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Does not give error when copying fails

See original GitHub issue

Nothing happens when I run the following script. I don’t get an error and no files are being produced.

#!/usr/bin/env node --harmony
const copyfiles = require('copyfiles');
const path = require('path');

const RAZOR_PATH = "Microsoft.AspNet.Razor.3.0.0/lib/net45/System.Web.Razor.dll"
const RAZORENG_PATH = "RazorEngine.3.8.2/lib/net45/RazorEngine.dll"
const JSON_PATH = "Newtonsoft.Json.8.0.3/lib/net45/Newtonsoft.Json.dll"
const destination = '.';
const paths = [ RAZOR_PATH, RAZORENG_PATH, JSON_PATH, destination ].map(path.normalize);
const opts = {};

copyfiles(paths, opts, function(err) {
    if(err) {
        console.error(`Failed copying dependencies: ${paths}`);
        process.exit(1);
    }

    console.log('.NET dependencies copied successfully')
});

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:1
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
Tiliavircommented, Oct 13, 2016

Ok that makes sense - I think adding a verbose flag, that logs a warning when a glob is not returning files would be sufficient for me - no idea what others think of this approach so…

0reactions
onurycommented, Aug 25, 2018

copyfiles does-not.exist out did not throw. so I’m here…

  • If copying a file without glob paths & file doesn’t exist or fails — should definitely throw an error.
  • If nothing gets copied at all — should definitely throw an error.
  • If any defined glob does not produce any files and/or dirs — should definitely throw an error.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Fix Unspecified Error When Copying File or Folder ... - EaseUS
If you receive the unspecified error while copying files or folders because the target disk is corrupted or the file is encrypted. You...
Read more >
[SOLVED] Copy and Paste Not Working on Windows 10
Copy and paste not working properly on your Windows 10 PC? Here's the real fix! Try these fixes and make your broken copy-paste...
Read more >
Unspecified Error When Copying a File Folder in Windows 10
Most of the time, you encounter this error because you don't have the ownership of the file or folder that you are willing...
Read more >
How to fix: Error copying file or folder, A device attached to the ...
To do so, go to the Settings menu on your iPhone, scroll down to Photos and then change the 'Transfer to MAC or...
Read more >
Files are copied OK, but I get an error?!?
You can see it when you manually select the path. The form is empty by default. I think this is the reason why...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found