Skip to content

Commit

Permalink
add babel'ed files to src folder so that you can directly install i…
Browse files Browse the repository at this point in the history
…t from github
  • Loading branch information
Kosta-Github committed Jun 20, 2016
1 parent 557f001 commit 4cd37ec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 1 addition & 5 deletions src/commands/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,8 @@ var Commands = function () {
options = options || {};
var script = this.complete.script(this.name, this.name || 'tabtab');

if (process.platform === 'win32') {
return debug('Windows shell completion not yet supported, skipping completion install');
}

var shell = process.env.SHELL;
if (shell) shell = shell.split('/').slice(-1)[0];
if (shell) shell = shell.split(process.platform !== 'win32' ? '/' : '\\').slice(-1)[0];
if (!this.installer[shell]) {
return debug('User shell %s not supported, skipping completion install', shell);
}
Expand Down
5 changes: 4 additions & 1 deletion src/installer.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ var Installer = function () {
var name = this.options.name;
var script = this.complete.script(name, this.options.completer || name, this.template);
var filename = _path2.default.join(__dirname, '../.completions', name + '.' + this.template);
if (process.platform === 'win32') {
filename = filename.replace(/\\/g, '/');
} // win32: replace backslashes with forward slashes
debug('Writing actual completion script to %s', filename);

// First write internal completion script in a local .comletions directory
Expand Down Expand Up @@ -237,7 +240,7 @@ var Installer = function () {

return new Promise(function (r, errback) {
var shell = process.env.SHELL;
if (shell) shell = shell.split('/').slice(-1)[0];
if (shell) shell = shell.split(process.platform !== 'win32' ? '/' : '\\').slice(-1)[0];

return _this4[shell]().then(r).catch(errback);
});
Expand Down

0 comments on commit 4cd37ec

Please sign in to comment.