For example: files.pathJoin('/something/', '/something/else') should
result into '/something/something/else' and here the caller doesn't
care if the passed arguments look like absolute paths or not. It can
even be a middle part of some larger path. We don't care and shouldn't
enforce it on files.pathJoin
Summary:
According to its contract, mkdir -p returns true if the directory
exists (and creates it if needed) and false if the item exists and isn't
a directory (so we couldn't make one). Because directory creation can
be concurrent, we need to wrap the actual mkdir call in a try/catch to handle
this issue (rather than just checking once).
This issue was always here. Previously, the race was against other apps editing
the same directory (which didn't come up that often). As of 1.0.3, files.js is a lot
more yieldy and this becomes a race condition on Meteor itself.
Test Plan: self-test
Reviewers: glasser
Differential Revision: https://phabricator.meteor.io/D15
This commit is based on the following design document:
https://mdg.hackpad.com/Creating-and-Updating-Docs-0ZyyDcSZDxp,
and some other stuff from here: https://mdg.hackpad.com/Meteor-Long-Description-wGZ1vIOwVlF
and was code reviewed here: https://github.com/meteor/meteor/pull/3375
It does the following:
- Allow the user to specify package documentation in Package.Describe.
We will take the README.md file by default, to make the transition easier.
Users can specify ‘documentation: null’ to not submit a README.md
- From that documentation, extract the section between the first and second header
to use as the long form description for the package.
- Upload the documentation to the server at publish-time. Allow metadata changes with ‘publish —update’.
- Change the default package skeleton to include the README.md file.
Also, changes the skeleton to have fewer useless placeholders in Package.describe values.
- Fix a minor bug where Git did not show up when running ‘meteor show’ on local packages.
A note on ‘documentation: null’ and blank documentation — we don’t let maintainers upload
blank README.md files, because we want to encourage people to fill them out. (Instead,
we allow a ‘documentation: null’ as an override) This is a UX issue! It is not a technical thing.
There is more discussion and code review in: https://github.com/meteor/meteor/pull/3375
Rather than waiting until process end.
Also, ensure that simultaneous calls to files.rm_recursive (possible now
that they can yield) can't throw ENOENT.
Fixes#3324.
This will be useful when we want to be smart with windows file paths later
Also, all of the file calls are asynchronous with fibers now, which comes with
many benefits.
This is a combination of 23 commits. Original messages:
Wrap a large number of fs calls inside files.*
Convert a few more fs calls to files.*
More moving fs.* to files
Implement read/write streams and open/read/close
Get rid of fs from auth.js
Remove fs and unused imports from catalog-local and catalog-remote
Remove unused imports from catalog.js
Replace a whole lot of fs calls
Fix error
Migrate a lot more fs. calls to files.
Add a temporary symlink method
Convert old test to files.*
Use files.pathX instead of path.x everywhere
Replace path.x to files.pathX in tests
Small fixes to files.js and one rename
Make cleanup run in a fiber
Make wrapping functions take function name in case we need it
Add some timeouts and stuff to HCP tests
wrapFsFunc also makes a sync version of the function
Sometimes you just don't want to yield!
Make sure JsImage readFromDisk doesn't yield
Remove unused imports from npm test
Change order of test now that some things don't yield
Fix missing files import, and add a debug error printout
- don't crash when listing upgraders (2 bugs, introduced on this branch)
- successfully write banners-shown file so that we sometimes print
shorter banners (introduced with sqlite)
- in self-test tropohouse, keep the sadly necessary symlinks
autoupdate test file now passes!
- the 'programs' subdirectory is no longer supported
- includeDebug is now an option to bundler.bundle, not global state
- some cordova-specific stuff has been disabled
- lots of other commands are presumably entirely broken
There is no longer a uniload catalog when running from a release, since
the release contains whole isopackets (programs) not
isopacks (packages).
We only need a uniload-specific catalog when we're actually rebuilding
isopackets (not in order to load them), so we now have it as a local
variable in the two places that build isopackets.
The deleted code in package-loader.js was specific to the prebuilt
uniload package which no longer exists.
Before this fix, we were producing tarballs that npm 'tar' couldn't
untar if the first file inside the top-level directory was not
writeable. (Which was indeed the case since the unipackage -> isopack
change, which resulted in isopack.json being the first file in built
package tarballs.) See comment for more explanation.
Before this fix, we were producing tarballs that npm 'tar' couldn't
untar if the first file inside the top-level directory was not
writeable. (Which was indeed the case since the unipackage -> isopack
change, which resulted in isopack.json being the first file in built
package tarballs.) See comment for more explanation.