Giter Club home page Giter Club logo

Comments (14)

searls avatar searls commented on July 4, 2024

Thanks for this load test.

from scripty.

searls avatar searls commented on July 4, 2024

Just to clarify:

  1. "test:browser": "scripty" is in your package.json, confirm?
  2. When you run npm run test:browser, both scripts/test/browser/dev.sh and scripts/test/browser/index.sh are being run, right?

What if you rename index.sh to index? If that fixes it then the lib/resolve-script/generate-glob module is probably to blame

from scripty.

searls avatar searls commented on July 4, 2024

As always I'd appreciate any help you can offer, whether it's a way to reproduce the issue, a test, or a PR. Thanks

from scripty.

boneskull avatar boneskull commented on July 4, 2024

"test:browser": "scripty" is in your package.json, confirm?

yes

When you run npm run test:browser, both scripts/test/browser/dev.sh and scripts/test/browser/index.sh are being run, right?

yes

What if you rename index.sh to index? If that fixes it then the lib/resolve-script/generate-glob module is probably to blame

This fixes the issue.

from scripty.

boneskull avatar boneskull commented on July 4, 2024

in generate-glob you could probably leverage the glob module to avoid both fs.statSync() calls, and fix this.

from scripty.

boneskull avatar boneskull commented on July 4, 2024

...but that may not be any faster. sounds silly to generate a globspec using glob

from scripty.

boneskull avatar boneskull commented on July 4, 2024

also: ensure index is not a directory 😄

looks like you have that covered

from scripty.

boneskull avatar boneskull commented on July 4, 2024

this line should probably be

return path.join(expanded, '*')

the following

return path.join(expanded, '/') + '*'

is not windows-safe, afaik. the purpose of join of course is to insert the proper directory separators for you

from scripty.

boneskull avatar boneskull commented on July 4, 2024
return fs.statSync(f + '/index').isFile()

isn't windows-safe either, right? probably want

return fs.statSync(path.join(f, 'index')).isFile()

but you may blow that away if you change your strategy anyway

from scripty.

boneskull avatar boneskull commented on July 4, 2024

I think you can do the index check before you do the dir check too.

this might do it:

// untested
module.exports = function (dir1, dir2) {
  var expanded = path.resolve(dir1, path.join.apply(this, dir2.split(':')))
  // find any index files beneath expanded.  if it's not a directory,
  // this will fail
  var indexGlob = path.join(expanded, 'index*')
  if (glob.sync(indexGlob, {nodir: true}).length) {
    return indexGlob
  }
  // check if expanded is actually a directory
  var dirGlob = path.join(expanded, path.sep)
  if (glob.sync(dirGlob).length) {
    return dirGlob + '*'
  }
  // otherwise, default
  return expanded + '*'
}

from scripty.

searls avatar searls commented on July 4, 2024

A couple questions:

  1. Are you on Windows?
  2. Are you able to reproduce with a test? I tried last night and failed

from scripty.

searls avatar searls commented on July 4, 2024

Nevermind, was able to reproduce

from scripty.

boneskull avatar boneskull commented on July 4, 2024

I'm not on Windows.

from scripty.

searls avatar searls commented on July 4, 2024

Thanks for your help with this. Fix landed in 1.2.3

from scripty.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.