Skip to content

Commit

Permalink
browserify: use xterm-256color. fix transform on windows. fixes chjj#167
Browse files Browse the repository at this point in the history
.
  • Loading branch information
chjj committed Aug 18, 2015
1 parent 1ae8604 commit 5ccc80d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions browser/transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ var requireWidgets = widgets.reduce(function(out, name) {
* terminfo or termcap, just use xterm terminfo/cap.
*/

var infoPath = path.resolve(__dirname, '..', 'usr', 'xterm')
var infoPath = path.resolve(__dirname, '..', 'usr', 'xterm-256color')
, capPath = path.resolve(__dirname, '..', 'usr', 'xterm.termcap');

var infoPathFake = path.resolve(
Expand Down Expand Up @@ -87,18 +87,18 @@ readMethods = readMethods.toString().slice(24, -2)
*/

function end(file, offset) {
return file.split(path.sep).slice(offset).join(path.sep);
return file.split(path.sep).slice(-offset).join('/');
}

/**
* Expose
*/

module.exports = function(file) {
if (end(file, -2) === 'lib/widget.js') {
if (end(file, 2) === 'lib/widget.js') {
return transformer(requireWidgets);
}
if (end(file, -2) === 'lib/tput.js') {
if (end(file, 2) === 'lib/tput.js') {
return transformer(readMethods);
}
return transformer();
Expand Down

0 comments on commit 5ccc80d

Please sign in to comment.