Do not fail if the `kiwixlib/src/main` doesn't exist when deleting him.

When deleting the directory, this is not a problem if the directory
doesn't exist.
This commit is contained in:
Matthieu Gautier 2017-05-02 14:28:30 +02:00
parent 39c2e67b80
commit a86d0b143b
1 changed files with 4 additions and 1 deletions

View File

@ -357,5 +357,8 @@ class KiwixAndroid(Dependency):
def _configure(self, context):
if not os.path.exists(self.build_path):
shutil.copytree(self.source_path, self.build_path)
shutil.rmtree(pj(self.build_path, 'kiwixlib', 'src', 'main'))
try:
shutil.rmtree(pj(self.build_path, 'kiwixlib', 'src', 'main'))
except FileNotFoundError:
pass
shutil.copytree(pj(self.buildEnv.install_dir, 'kiwix-lib'), pj(self.build_path, 'kiwixlib', 'src', 'main'))