Use fs.stat to check directory status (#880)

pull/881/head
cgewecke 8 months ago committed by GitHub
parent a20fbf7b11
commit 66fda89e69
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      plugins/resources/plugin.utils.js

@ -135,9 +135,9 @@ function assembleFiles(config, skipFiles=[]){
let targetsPath;
// The targets (contractsDir) could actually be a single named file (OR a folder)
const extName = path.extname(config.contractsDir);
const isDirectory = fs.statSync(config.contractsDir).isDirectory();
if (extName.length !== 0) {
if (!isDirectory) {
targets = [ path.normalize(config.contractsDir) ];
} else {
targetsPath = path.join(config.contractsDir, '**', '*.{sol,vy}');

Loading…
Cancel
Save