Skip to content

[Bug] Supplying folder for --lib results in no lib files found #714

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jtenner opened this issue Jul 16, 2019 · 4 comments
Closed

[Bug] Supplying folder for --lib results in no lib files found #714

jtenner opened this issue Jul 16, 2019 · 4 comments

Comments

@jtenner
Copy link
Contributor

jtenner commented Jul 16, 2019

I tried to follow the error as best as I can and I found the problem inside listFilesNode()

  function listFilesNode(dirname, baseDir) {
    var files;
    try {
      stats.readTime += measure(() => {
        console.log(baseDir, dirname);
        files = fs.readdirSync(path.join(baseDir, dirname)).filter(file => /^(?!.*\.d\.ts$).*\.ts$/.test(file));
      });
      return files;
    } catch (e) {
      return [];
    }
  }

When this function is called, baseDir is undefined.

Can be fixed by calling libFiles = listFiles(libDir, baseDir); instead.

Which file should be changed exactly? Is it the assemblyscript/cli/asc.js file? If so, I'd be happy to write a pull request with that change.

@jtenner jtenner changed the title Supplying folder for --lib results in no lib files found [Bug] Supplying folder for --lib results in no lib files found Jul 16, 2019
@willemneal
Copy link
Contributor

Yep that's the one. Though this has me wondering what your use case is? Could it not be solved with package management, e.i #594?

@jtenner
Copy link
Contributor Author

jtenner commented Jul 16, 2019

Use case is I want to supply an assembly folder to export all the assembly root files as globals. This is expected behavior according to @dcodeIO

@MaxGraey
Copy link
Member

@jtenner Is it still relevant issue?

@jtenner
Copy link
Contributor Author

jtenner commented Jul 28, 2019

No this not. This how the assemblyscript/node project sets up tests. I think I submitted the pull request to fix it.

@jtenner jtenner closed this as completed Jul 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants