refactor readTermcap
This commit is contained in:
parent
fb752f1783
commit
f83e3304d1
|
@ -750,12 +750,8 @@ Tput.prototype.readTermcap = function() {
|
|||
|
||||
this.termcap = {};
|
||||
|
||||
if (process.env.TERMCAP) {
|
||||
this.termcap.data = process.env.TERMCAP;
|
||||
} else {
|
||||
var file = path.resolve('/etc/termcap');
|
||||
this.termcap.data = fs.readFileSync(file, 'utf8');
|
||||
}
|
||||
this.termcap.data = process.env.TERMCAP
|
||||
|| fs.readFileSync('/etc/termcap', 'ascii');
|
||||
|
||||
this.termcap.terms = this.parseTermcap(this.termcap.data);
|
||||
this.termcap.info = this.termcap.terms[this.term];
|
||||
|
|
Loading…
Reference in New Issue