Prechádzať zdrojové kódy

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

yhz 6 rokov pred
rodič
commit
623c209346
1 zmenil súbory, kde vykonal 3 pridanie a 2 odobranie
  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):