Commits

firefly  committed 35d7bc4

Fixing bug with Eldis.mode, hopefully fixing bug with Eldis.version.

  • Participants
  • Parent commits 93b02cb

Comments (0)

Files changed (1)

 Eldis.version = function() {
 	if (Eldis._version) {
 		return Eldis._version;
-	} else if (Eldis.exec('which hg 2>&1 >/dev/null; echo $?' == '0')) {
+	} else if (Eldis.exec('which hg 2>&1 >/dev/null; echo $?' == '0' && Eldis.exec('[ -e .hg ]'))) {
 		var rev = Eldis.exec('hg summary | head -n 1')[0].replace(/parent: (\d+):([^ ]+) .*/, 'rev $1 ($2)');
 		Eldis.exec("echo '" + rev + "' >version");
-	} else if (Eldis.exec('\[ -e version \]')) {
+	} else if (Eldis.exec('[ -e version ]')) {
 		var rev = Eldis.exec("cat rev").join(" ");
 	} else {
 		var rev = "(unknown revision)";
 };
 Eldis.mode = function(channel) {
 	var server = Eldis.state.server;
-	EldisJava.raw(server, 'MODE ' + channel + ' ' + arguments.slice(2).join(' '));
+	EldisJava.raw(server, 'MODE ' + channel + ' :' + Array.prototype.slice.call(arguments, 2).join(' '));
 };
 Eldis.raw = function(server, raw) {
 	EldisJava.raw(server, raw);