Pana / nrm

NPM registry manager, fast switch between different registries: npm, cnpm, nj, taobao
MIT License
2.81k stars 250 forks source link

修复nrm ls不显示星号问题,顺便修复nrm current不显示问题 #110

Closed xiaoyu-666 closed 3 years ago

xiaoyu-666 commented 3 years ago

初次下载nrm使用nrm ls打印地址列表是不显示星号的, 使用nrm use taobao时,文件.nrmrc是空的,所以以下判断是不成立的

if (hasOwnProperty(customRegistries, name) && (name in registries || customRegistries[name].registry === registry.registry)) {
                    registry[FIELD_IS_CURRENT] = true;
                    customRegistries[name] = registry;
}

所以我删除了判断条件,保留了以下内容

  registry[FIELD_IS_CURRENT] = true;
  customRegistries[name] = registry;

直接写入文件即可,亲测显示正常

CaptainOfPhB commented 3 years ago

duplicated with #108

xiaoyu-666 commented 3 years ago

duplicated with #108 既然已经解决了,那我关闭提交了