You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

31 lines
674 B

  1. # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
  2. # MIT License. See license.txt
  3. # make public folders
  4. from __future__ import unicode_literals
  5. import os
  6. def make():
  7. """make public folder symlinks if missing"""
  8. dirs = ["public", "public/js", "public/css", "public/files", "public/backups"]
  9. for dirname in dirs:
  10. if not os.path.exists(dirname):
  11. os.mkdir(dirname)
  12. os.chdir("public")
  13. symlinks = [
  14. ["app", "../app/public"],
  15. ["lib", "../lib/public"],
  16. ["unsupported.html", "../lib/public/html/unsupported.html"]
  17. ]
  18. for link in symlinks:
  19. if not os.path.exists(link[0]) and os.path.exists(link[1]):
  20. os.symlink(link[1], link[0])
  21. os.chdir('..')