Comments (14)
Thanks for this load test.
from scripty.
Just to clarify:
"test:browser": "scripty"
is in your package.json, confirm?- When you run
npm run test:browser
, bothscripts/test/browser/dev.sh
andscripts/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.
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.
"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.
in generate-glob
you could probably leverage the glob module to avoid both fs.statSync()
calls, and fix this.
from scripty.
...but that may not be any faster. sounds silly to generate a globspec using glob
from scripty.
also: ensure index
is not a directory 😄
looks like you have that covered
from scripty.
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.
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.
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.
A couple questions:
- Are you on Windows?
- Are you able to reproduce with a test? I tried last night and failed
from scripty.
Nevermind, was able to reproduce
from scripty.
I'm not on Windows.
from scripty.
Thanks for your help with this. Fix landed in 1.2.3
from scripty.
Related Issues (20)
- The scripty.path config is not work. HOT 2
- Bug while sharing scripts via node modules HOT 3
- Update dependency to remove vulnerability. HOT 2
- Scripts Path Not Read With Yarn 3
- PNPM Support HOT 3
- monorepo single config HOT 2
- In MAC, may be unenforceable directory, how can do before running scripts, automatically run chmod + x scripts/path/to/my/script HOT 7
- scripty ERR! It seems you may be running scripty from the command-line directly HOT 1
- pnpm build error, unknown options: 'commitizen_path', 'scripty_path', 'scripty_windowsPath' #
- Scripts fail with Node.js v >=18 HOT 3
- Revive builtIn scripts resolver HOT 2
- Batch scripts skip directories HOT 1
- Sharable scripts via a npm package HOT 3
- Default to silent mode; allow verbose option HOT 1
- multiple script locations HOT 6
- Allow directly running using "scripty <target>" HOT 8
- npm proposal for proxying "npm run"
- Script name and content is always printed HOT 3
- Issue while running scripty on windows10 HOT 7
- Options won't work with npm >= 7 HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scripty.