From 68ff4aa2d128b0045e2a6a47598b3fd2f3fd7cc0 Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Fri, 7 Mar 2014 11:42:42 -0700 Subject: [PATCH] fixing issue related to local cache name, see issue #163 --- cmd/drone/drone.go | 2 +- cmd/droned/assets/js/main.js | 132 +++++++++++++++++------------------ 2 files changed, 67 insertions(+), 67 deletions(-) diff --git a/cmd/drone/drone.go b/cmd/drone/drone.go index bb84f5678..ca20dd262 100644 --- a/cmd/drone/drone.go +++ b/cmd/drone/drone.go @@ -134,7 +134,7 @@ func run(path string) { } // get the repository root directory - dir := filepath.Dir(path) + dir := filepath.Base(filepath.Dir(path)) code := repo.Repo{ Name: dir, Branch: "HEAD", // should we do this? diff --git a/cmd/droned/assets/js/main.js b/cmd/droned/assets/js/main.js index 5863899f2..af32d8188 100644 --- a/cmd/droned/assets/js/main.js +++ b/cmd/droned/assets/js/main.js @@ -1,3 +1,69 @@ +;// Format ANSI to HTML + +if(typeof(Drone) === 'undefined') { Drone = {}; } + +(function() { + Drone.LineFormatter = function() {}; + + Drone.LineFormatter.prototype = { + regex: /\u001B\[([0-9]+;?)*[Km]/g, + styles: [], + + format: function(s) { + // Check for newline and early exit? + s = s.replace(//g, ">"); + + var output = ""; + var current = 0; + while (m = this.regex.exec(s)) { + var part = s.substring(current, m.index); + current = this.regex.lastIndex; + + var token = s.substr(m.index, this.regex.lastIndex - m.index); + var code = token.substr(2, token.length-2); + + var pre = ""; + var post = ""; + + switch (code) { + case 'm': + case '0m': + var len = this.styles.length; + for (var i=0; i < len; i++) { + this.styles.pop(); + post += "" + } + break; + case '30;42m': pre = ''; break; + case '36m': + case '36;1m': pre = ''; break; + case '31m': + case '31;31m': pre = ''; break; + case '33m': + case '33;33m': pre = ''; break; + case '32m': + case '0;32m': pre = ''; break; + case '90m': pre = ''; break; + case 'K': + case '0K': + case '1K': + case '2K': break; + } + + if (pre !== "") { + this.styles.push(pre); + } + + output += part + pre + post; + } + + var part = s.substring(current, s.length); + output += part; + return output; + } + }; +})(); ;// Live commit updates if(typeof(Drone) === 'undefined') { Drone = {}; } @@ -96,69 +162,3 @@ if(typeof(Drone) === 'undefined') { Drone = {}; } }; })(); -;// Format ANSI to HTML - -if(typeof(Drone) === 'undefined') { Drone = {}; } - -(function() { - Drone.LineFormatter = function() {}; - - Drone.LineFormatter.prototype = { - regex: /\u001B\[([0-9]+;?)*[Km]/g, - styles: [], - - format: function(s) { - // Check for newline and early exit? - s = s.replace(//g, ">"); - - var output = ""; - var current = 0; - while (m = this.regex.exec(s)) { - var part = s.substring(current, m.index); - current = this.regex.lastIndex; - - var token = s.substr(m.index, this.regex.lastIndex - m.index); - var code = token.substr(2, token.length-2); - - var pre = ""; - var post = ""; - - switch (code) { - case 'm': - case '0m': - var len = this.styles.length; - for (var i=0; i < len; i++) { - this.styles.pop(); - post += "" - } - break; - case '30;42m': pre = ''; break; - case '36m': - case '36;1m': pre = ''; break; - case '31m': - case '31;31m': pre = ''; break; - case '33m': - case '33;33m': pre = ''; break; - case '32m': - case '0;32m': pre = ''; break; - case '90m': pre = ''; break; - case 'K': - case '0K': - case '1K': - case '2K': break; - } - - if (pre !== "") { - this.styles.push(pre); - } - - output += part + pre + post; - } - - var part = s.substring(current, s.length); - output += part; - return output; - } - }; -})();