Эх сурвалжийг харах

Make postinstall more robust

raylu 14 жил өмнө
parent
commit
418ca3fc0d
4 өөрчлөгдсөн 7 нэмэгдсэн , 2 устгасан
  1. 1 0
      .gitignore
  2. 6 1
      postinstall
  3. 0 1
      pyc/urls.py
  4. 0 0
      static/placeholder

+ 1 - 0
.gitignore

@@ -1,2 +1,3 @@
 *.pyc
 pyc/pyc.db
+static/admin

+ 6 - 1
postinstall

@@ -10,5 +10,10 @@ admindir = os.path.dirname(django.contrib.admin.__file__)
 mediadir = os.path.join(admindir, 'media')
 
 staticlink = os.path.join('static', 'admin')
-if not os.path.islink(staticlink):
+if os.path.exists(staticlink):
+	if not os.path.islink(staticlink):
+		print "Removing", staticlink
+		os.unlink(staticlink)
+		os.symlink(mediadir, staticlink)
+else:
 	os.symlink(mediadir, staticlink)

+ 0 - 1
pyc/urls.py

@@ -4,7 +4,6 @@ from django.contrib import admin
 admin.autodiscover()
 
 urlpatterns = patterns('',
-    # Examples:
     # url(r'^$', 'pyc.views.home', name='home'),
     # url(r'^pyc/', include('pyc.foo.urls')),
 

+ 0 - 0
static/placeholder