Ticket #480 (closed defect: fixed)

Opened 14 years ago

Last modified 14 years ago

Trac highlights /bin/sh scripts and not /bin/bash ones

Reported by: geofft Owned by:
Priority: trivial Milestone:
Component: -- Keywords:
Cc: Fixed in version:
Upstream bug:

Change History

comment:1 Changed 14 years ago by broder

  • Status changed from new to closed
  • Resolution set to fixed

Fixed with the most awesome-est monkey-patch ever:

--- trac.fcgi.orig	2010-04-02 22:07:07.000000000 -0400
+++ trac.fcgi	2010-04-02 22:06:33.000000000 -0400
@@ -2,9 +2,12 @@
 
 import os
 from trac.web import fcgi_frontend
+from trac.mimeview import api
 import urlparse
 
 os.environ['TRAC_ENV'] = '/afs/sipb.mit.edu/project/debathena/trac/debathena'
+api.KNOWN_MIME_TYPES['application/x-sh'].append('bash')
+api.MIME_MAP['bash'] = 'application/x-sh'
 
 def my_dispatch_request(environ, start_response):
     if ('REDIRECT_URL' in environ and 'PATH_INFO' in environ

comment:2 Changed 14 years ago by broder

Fixed more cleverly using  trac:comment:ticket:4016:3

Note: See TracTickets for help on using tickets.