Skip to content
This repository has been archived by the owner on Dec 28, 2022. It is now read-only.

Checking out files prints undefined even though the file is checked out #14

Closed
Gum-Joe opened this issue Sep 1, 2015 · 2 comments
Closed

Comments

@Gum-Joe
Copy link
Owner

Gum-Joe commented Sep 1, 2015

File: boot/libs/checks/checkFile.js
Code:

var fs = require('fs')
var path = require('path')
var clicolour = require('cli-color')
var error = require('../../../libs/error/bsod.js')

var files = ["app.js", "node_modules", "libs"];

var i;

exports.checkFiles = function checkFiles(x){
  // TODO: Fix issue where files[i] is undefined
  console.log(clicolour.yellowBright("ALPHA:")+"Checking out files need fixing, does in fact check out files correctly");
  for (var i = 0; i < files.length; i++) {
    fs.stat(files[i], function(err, stat){
      if(err === null){
          return console.log('Checked out file '+files[i]+"..."+clicolour.greenBright("OK"));
          console.log(i);
        }
        else if( err.code == 'ENOENT'){
          console.log('Checked out file '+files[i]+"..."+clicolour.redBright("ERROR!"));
          throw error.throwError("BOOT_"+err.code+"_CHECKS_NOT_FOUND:"+files[i], err, err.code);
        }
        else{
          console.log('Checked out file '+files[i]+"..."+clicolour.redBright("ERROR!"));
          throw error.throwError("BOOT_CHECKS_FILES_"+err.code+":"+files[i], err, err.code);
            }
          });
  }
});
};

Output:

Checked out file undefined...OK
Checked out file undefined...OK
Checked out file undefined...OK

@Gum-Joe
Copy link
Owner Author

Gum-Joe commented Jan 22, 2016

Feature disabled.

@Gum-Joe
Copy link
Owner Author

Gum-Joe commented Jan 27, 2016

Probably not needing this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant