mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Merge branch 'pr/1808' into devel
This commit is contained in:
@@ -55,6 +55,8 @@
|
||||
* Meteor accounts logins (or anything else using the `localstorage` package) no
|
||||
longer persist in IE7.
|
||||
|
||||
* Don't lose permissions (eg, executable bit) on npm files. #1808
|
||||
|
||||
|
||||
## v0.7.0.1
|
||||
|
||||
|
||||
@@ -345,7 +345,8 @@ _.extend(Builder.prototype, {
|
||||
var thisAbsFrom = path.resolve(absFrom, item);
|
||||
var thisRelTo = path.join(relTo, item);
|
||||
|
||||
var isDir = fs.statSync(thisAbsFrom).isDirectory();
|
||||
var fileStatus = fs.statSync(thisAbsFrom);
|
||||
var isDir = fileStatus.isDirectory();
|
||||
var itemForMatch = item;
|
||||
if (isDir)
|
||||
itemForMatch += '/';
|
||||
@@ -362,7 +363,8 @@ _.extend(Builder.prototype, {
|
||||
// XXX avoid reading whole file into memory
|
||||
var data = fs.readFileSync(thisAbsFrom);
|
||||
|
||||
fs.writeFileSync(path.resolve(self.buildPath, thisRelTo), data);
|
||||
fs.writeFileSync(path.resolve(self.buildPath, thisRelTo), data,
|
||||
{ mode: fileStatus.mode });
|
||||
self.usedAsFile[thisRelTo] = true;
|
||||
});
|
||||
};
|
||||
|
||||
1
tools/tests/apps/npmtest/.meteor/.gitignore
vendored
Normal file
1
tools/tests/apps/npmtest/.meteor/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
local
|
||||
7
tools/tests/apps/npmtest/.meteor/packages
Normal file
7
tools/tests/apps/npmtest/.meteor/packages
Normal file
@@ -0,0 +1,7 @@
|
||||
# Meteor packages used by this project, one per line.
|
||||
#
|
||||
# 'meteor add' and 'meteor remove' will edit this file for you,
|
||||
# but you can also edit it by hand.
|
||||
|
||||
standard-app-packages
|
||||
npm-test
|
||||
1
tools/tests/apps/npmtest/.meteor/release
Normal file
1
tools/tests/apps/npmtest/.meteor/release
Normal file
@@ -0,0 +1 @@
|
||||
none
|
||||
2
tools/tests/apps/npmtest/packages/npm-test/npmtest.js
Normal file
2
tools/tests/apps/npmtest/packages/npm-test/npmtest.js
Normal file
@@ -0,0 +1,2 @@
|
||||
// This will execute a shell script, print its output, and process.exit(0).
|
||||
Npm.require('meteor-test-executable').doIt();
|
||||
5
tools/tests/apps/npmtest/packages/npm-test/package.js
Normal file
5
tools/tests/apps/npmtest/packages/npm-test/package.js
Normal file
@@ -0,0 +1,5 @@
|
||||
Npm.depends({"meteor-test-executable": "0.0.1"});
|
||||
|
||||
Package.on_use(function (api) {
|
||||
api.add_files("npmtest.js", "server");
|
||||
});
|
||||
36
tools/tests/npm.js
Normal file
36
tools/tests/npm.js
Normal file
@@ -0,0 +1,36 @@
|
||||
var selftest = require('../selftest.js');
|
||||
var Sandbox = selftest.Sandbox;
|
||||
var utils = require('../utils.js');
|
||||
var net = require('net');
|
||||
var Future = require('fibers/future');
|
||||
var _ = require('underscore');
|
||||
var files = require('../files.js');
|
||||
|
||||
var MONGO_LISTENING =
|
||||
{ stdout: " [initandlisten] waiting for connections on port" };
|
||||
|
||||
selftest.define("npm", ["net"], function () {
|
||||
var s = new Sandbox({ fakeMongo: true });
|
||||
var run;
|
||||
|
||||
s.createApp("npmtestapp", "npmtest");
|
||||
s.cd("npmtestapp");
|
||||
|
||||
// Ensure that we don't lose the executable bits of npm modules.
|
||||
// Regression test for https://github.com/meteor/meteor/pull/1808
|
||||
// Before this fix, the module would work on the first execution but not on a
|
||||
// subsequent one.
|
||||
_.times(2, function (i) {
|
||||
run = s.run("--once", "--raw-logs");
|
||||
run.tellMongo(MONGO_LISTENING);
|
||||
if (i === 0) {
|
||||
run.waitSecs(2);
|
||||
run.read(
|
||||
"npm-test: updating npm dependencies -- meteor-test-executable...\n");
|
||||
}
|
||||
run.waitSecs(15);
|
||||
run.read("null; From shell script\n");
|
||||
run.expectEnd();
|
||||
run.expectExit(0);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user