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