Skip to content
This repository has been archived by the owner on Jun 2, 2024. It is now read-only.

Commit

Permalink
Merge pull request #296 from cnpm/sync-with-local
Browse files Browse the repository at this point in the history
dont sync local package field. fix #295
  • Loading branch information
dead-horse committed Mar 27, 2014
2 parents ad3602b + 425e430 commit 7604216
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 19 deletions.
24 changes: 7 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ install:
@npm install --registry=http://r.cnpmjs.org \
--disturl=http://dist.cnpmjs.org

jshint:
jshint: install
@-./node_modules/.bin/jshint ./

test:
test: install
@NODE_ENV=test ./node_modules/.bin/mocha \
--harmony-generators \
--reporter $(REPORTER) \
Expand All @@ -20,33 +20,23 @@ test:
$(MOCHA_OPTS) \
$(TESTS)


test-cov:
test-cov cov: install
@NODE_ENV=test node --harmony \
node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha \
node_modules/.bin/istanbul cover --preserve-comments \
./node_modules/.bin/_mocha \
-- -u exports \
--reporter $(REPORTER) \
--timeout $(TIMEOUT) \
--require should \
--require co-mocha\
$(MOCHA_OPTS) \
$(TESTS)
@-$(MAKE) check-coverage

check-coverage:
@./node_modules/.bin/istanbul check-coverage \
--statements 100 \
--functions 100 \
--branches 100 \
--lines 100

cov:
@./node_modules/.bin/cov coverage

contributors:
contributors: install
@./node_modules/.bin/contributors -f plain -o AUTHORS

autod:
autod: install
@./node_modules/.bin/autod -w -e public,view,docs,backup,coverage
@$(MAKE) install

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"co-mocha": "0.0.2",
"contributors": "*",
"cov": "*",
"istanbul": "git://github.com/gotwarlost/istanbul.git#harmony",
"istanbul-harmony": "*",
"jshint": "*",
"mm": "0.2.1",
"mocha": "*",
Expand Down
2 changes: 2 additions & 0 deletions proxy/sync_module_worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,8 @@ SyncModuleWorker.prototype._syncOneVersion = function *(versionIndex, sourcePack
publish_time: sourcePackage.publish_time,
};

// delete _publish_on_cnpm, because other cnpm maybe sync from current cnpm
delete mod.package._publish_on_cnpm;
if (that._publish) {
// sync as publish
mod.package._publish_on_cnpm = true;
Expand Down
4 changes: 3 additions & 1 deletion test/proxy/sync_module_worker.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ describe('proxy/sync_module_worker.test.js', function () {

worker.start();
worker.on('end', function () {
worker.successes.concat(worker.fails).should.eql(['cnpmjs.org', 'cutter']);
var names = worker.successes.concat(worker.fails);
names.sort();
names.should.eql(['cnpmjs.org', 'cutter']);
done();
});
});
Expand Down
3 changes: 3 additions & 0 deletions test/sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
var SyncModuleWorker = require('../proxy/sync_module_worker');
var mysql = require('../common/mysql');
var Log = require('../proxy/module_log');
var config = require('../config');

config.sourceNpmRegistry = 'http://r.cnpmjs.org';

var names = process.argv[2] || 'byte';
names = names.split(',');
Expand Down

0 comments on commit 7604216

Please sign in to comment.