Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Unified Diff: devserver.py

Issue 6254022: Don't wipe cache dir, only its contents. (Closed) Base URL: http://git.chromium.org/git/dev-util.git@master
Patch Set: Fix cache Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: devserver.py
diff --git a/devserver.py b/devserver.py
index bf5e6d974abb2d432f745a36eea6559e9ab58cb9..208b3a626a8079eadf70f70d6c892763a8c6f7d7 100755
--- a/devserver.py
+++ b/devserver.py
@@ -166,8 +166,8 @@ if __name__ == '__main__':
cherrypy.log('Using cache directory %s' % cache_dir, 'DEVSERVER')
if options.clear_cache:
- # Clear the cache and exit on error
- if os.system('sudo rm -rf %s' % cache_dir) != 0:
+ # Clear the cache and exit on error.
+ if os.system('rm -rf %s/*' % cache_dir) != 0:
dgarrett 2011/01/27 22:43:38 I think this will give an error if the cache direc
cherrypy.log('Failed to clear the cache with %s' % cmd,
'DEVSERVER')
sys.exit(1)
@@ -180,6 +180,8 @@ if __name__ == '__main__':
cherrypy.log('Failed to clean up old delta cache files with %s' % cmd,
'DEVSERVER')
sys.exit(1)
+ else:
+ os.makedirs(cache_dir)
cherrypy.log('Source root is %s' % root_dir, 'DEVSERVER')
cherrypy.log('Serving from %s' % static_dir, 'DEVSERVER')
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698