Browse Source

增加判断删除资源是否存在

yhz 6 years ago
parent
commit
623c209346
1 changed files with 3 additions and 2 deletions
  1. 3 2
      package_utils_record.py

+ 3 - 2
package_utils_record.py

@@ -167,8 +167,9 @@ def removeOldRes(game, sdk, subChannel, config):
     decompliePath = file_utils.getDecompliePath(game, sdk, subChannel, config['cache'])
     for subPath in config['deleteList']:
         resPath = os.path.join(decompliePath, subPath)
-        os.remove(resPath)
-        print('delete ' + resPath)
+        if os.path.exists(resPath):
+            os.remove(resPath)
+            print('delete ' + resPath)
     return 0
 
 def removeOldCode(game, sdk, subChannel, config):