Permalink
Browse files

更新REPL

  • Loading branch information...
1 parent 21c6b2c commit 82f347dda4d3d56fdca47d24c24a09944e0025bd @leizongmin committed Oct 29, 2015
Showing with 3 additions and 4 deletions.
  1. +3 −4 repl
View
@@ -3,15 +3,14 @@
var fs = require('fs');
var path = require('path');
var repl = require('repl');
-var Segment = require('./');
var r = repl.start('> ');
var c = r.context;
c._load = function () {
- c.Segment = Segment;
- var segment = new Segment();
+ c.Segment = require('./');
+ var segment = new c.Segment();
segment.useDefault();
c.segment = segment;
c.s = function () {
@@ -28,7 +27,7 @@ c.reload = function () {
var dir = path.resolve(__dirname) + path.sep;
for (var i in require.cache) {
if (i.indexOf(dir) === 0) {
- delete require.cache;
+ delete require.cache[i];
// console.log('delete %s', i);
}
}

0 comments on commit 82f347d

Please sign in to comment.