Merge branch 'pr/1808' into devel

This commit is contained in:
David Glasser
2014-02-14 00:20:24 -08:00
8 changed files with 58 additions and 2 deletions

View File

@@ -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

View File

@@ -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;
});
};

View File

@@ -0,0 +1 @@
local

View 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

View File

@@ -0,0 +1 @@
none

View File

@@ -0,0 +1,2 @@
// This will execute a shell script, print its output, and process.exit(0).
Npm.require('meteor-test-executable').doIt();

View 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
View 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);
});
});