From 94a6e11354e54b56dcefae27e9b1b10934e07a17 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 1 Oct 2014 08:20:45 -0400 Subject: [PATCH] feature(konsole) ^P: rm last slash from path --- lib/client/konsole.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/client/konsole.js b/lib/client/konsole.js index 933c1e2b..6d00294c 100644 --- a/lib/client/konsole.js +++ b/lib/client/konsole.js @@ -1,6 +1,6 @@ -var CloudCmd, Util, join, DOM, Console; +var CloudCmd, Util, join, DOM, CloudFunc, Console; -(function(CloudCmd, Util, join, DOM) { +(function(CloudCmd, Util, join, DOM, CloudFunc) { 'use strict'; CloudCmd.Konsole = ConsoleProto; @@ -46,9 +46,12 @@ var CloudCmd, Util, join, DOM, Console; Console.addShortCuts({ 'P': function() { - var command = Console.getPromptText(); + var command = Console.getPromptText(), + path = DOM.getCurrentDirPath(); + + path = CloudFunc.rmLastSlash(path); - command += DOM.getCurrentDirPath(); + command += path; Console.setPromptText(command); } }); @@ -81,4 +84,4 @@ var CloudCmd, Util, join, DOM, Console; init(); } -})(CloudCmd, Util, join, DOM); +})(CloudCmd, Util, join, DOM, CloudFunc);