From e2601db9d59f3276fc929fc57b17a029b68b51d5 Mon Sep 17 00:00:00 2001 From: rzaitov Date: Tue, 12 Nov 2013 13:00:02 +0400 Subject: [PATCH] =?UTF-8?q?=D0=B2=D1=8B=D1=87=D0=B8=D1=81=D0=BB=D1=8F?= =?UTF-8?q?=D1=8E=20=D0=BF=D1=83=D1=82=D0=B8=20=D0=B4=D0=BB=D1=8F=20=D0=B1?= =?UTF-8?q?=D1=8D=D0=BA=D0=B0=D0=BF=D0=B0=20=D0=BD=D0=B0=20=D1=8D=D1=82?= =?UTF-8?q?=D0=B0=D0=BF=D0=B5=20=D1=81=D0=BE=D0=B7=D0=B4=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D1=8F=20=D0=BA=D0=BE=D0=BC=D0=BC=D0=B0=D0=BD=D0=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/IosSetupSteps.txt | 4 ++-- scripts/IosSteps.txt | 4 ++-- .../commands/BaseBackupCommand/BaseBackupCommand.py | 5 +++++ .../commands/BaseBackupCommand/CreateBackupCommand.py | 9 ++------- .../commands/BaseBackupCommand/DeleteBackupCommand.py | 4 +--- .../commands/BaseBackupCommand/RestoreBackupCommand.py | 9 +++------ 6 files changed, 15 insertions(+), 20 deletions(-) diff --git a/scripts/IosSetupSteps.txt b/scripts/IosSetupSteps.txt index 441a651..e788e1a 100644 --- a/scripts/IosSetupSteps.txt +++ b/scripts/IosSetupSteps.txt @@ -1,5 +1,5 @@ -restore from backup 'BuildSample' # восстанавливаем из бэкапа (исходники от сборки предыдущей конфигурации могут быть модифицированными) -create backup for 'BuildSample' +restore from backup '.' # восстанавливаем из бэкапа (исходники от сборки предыдущей конфигурации могут быть модифицированными) +create backup for '.' inside 'BuildSample/BuildSample.sln' remove NotCompileApp project diff --git a/scripts/IosSteps.txt b/scripts/IosSteps.txt index b3a3f4b..7a70b9b 100644 --- a/scripts/IosSteps.txt +++ b/scripts/IosSteps.txt @@ -12,5 +12,5 @@ sh cp -a BuildSample/BuildSample/Output/ Output/Appstore/ publish 'Output/Appstore/Artifacts/BuildSample-{@version}.ipa' to testflight notes = 'Hello' api_token = '{@tf_api_token}' team_token = '{@tf_team_token}' -restore from backup 'BuildSample' -delete backup 'BuildSample' \ No newline at end of file +restore from backup '.' +delete backup '.' \ No newline at end of file diff --git a/scripts/TouchinBuild/commands/BaseBackupCommand/BaseBackupCommand.py b/scripts/TouchinBuild/commands/BaseBackupCommand/BaseBackupCommand.py index a8f102d..4a0540c 100644 --- a/scripts/TouchinBuild/commands/BaseBackupCommand/BaseBackupCommand.py +++ b/scripts/TouchinBuild/commands/BaseBackupCommand/BaseBackupCommand.py @@ -7,6 +7,11 @@ class BaseBackupCommand: self.folderPath = folderPath + # вычислять абсолютные пути надо на этапе создания комманды + # поскольку на этапе выполнения текущая директория может быть удалена + self.srcAbsPath = self.getAbsSrc() + self.backupAbsPath = self.getAbsDst() + def getAbsSrc(self): return self.getAbs(self.folderPath) diff --git a/scripts/TouchinBuild/commands/BaseBackupCommand/CreateBackupCommand.py b/scripts/TouchinBuild/commands/BaseBackupCommand/CreateBackupCommand.py index 6658758..adba2df 100644 --- a/scripts/TouchinBuild/commands/BaseBackupCommand/CreateBackupCommand.py +++ b/scripts/TouchinBuild/commands/BaseBackupCommand/CreateBackupCommand.py @@ -7,10 +7,5 @@ class CreateBackupCommand(BaseBackupCommand): BaseBackupCommand.__init__(self, folderPath) def execute(self): - src = self.getAbsSrc() - backupDir = self.getAbsDst() - - print src, backupDir - - shutil.rmtree(backupDir, ignore_errors=True) - shutil.copytree(src, backupDir, symlinks=False) \ No newline at end of file + shutil.rmtree(self.backupAbsPath, ignore_errors=True) + shutil.copytree(self.srcAbsPath, self.backupAbsPath, symlinks=False) \ No newline at end of file diff --git a/scripts/TouchinBuild/commands/BaseBackupCommand/DeleteBackupCommand.py b/scripts/TouchinBuild/commands/BaseBackupCommand/DeleteBackupCommand.py index 1e0c319..ebdad25 100644 --- a/scripts/TouchinBuild/commands/BaseBackupCommand/DeleteBackupCommand.py +++ b/scripts/TouchinBuild/commands/BaseBackupCommand/DeleteBackupCommand.py @@ -7,6 +7,4 @@ class DeleteBackupCommand(BaseBackupCommand): BaseBackupCommand.__init__(self, backupArguments) def execute(self): - backupDir = self.getAbsDst() - - shutil.rmtree(backupDir, ignore_errors=True) + shutil.rmtree(self.backupAbsPath, ignore_errors=True) diff --git a/scripts/TouchinBuild/commands/BaseBackupCommand/RestoreBackupCommand.py b/scripts/TouchinBuild/commands/BaseBackupCommand/RestoreBackupCommand.py index 61b6747..e176153 100644 --- a/scripts/TouchinBuild/commands/BaseBackupCommand/RestoreBackupCommand.py +++ b/scripts/TouchinBuild/commands/BaseBackupCommand/RestoreBackupCommand.py @@ -8,9 +8,6 @@ class RestoreBackupCommand(BaseBackupCommand): BaseBackupCommand.__init__(self, folderPath) def execute(self): - src = self.getAbsSrc() - backupDir = self.getAbsDst() - - if os.path.exists(backupDir): - shutil.rmtree(src, ignore_errors=True) - shutil.copytree(backupDir, src, symlinks=False) + if os.path.exists(self.backupAbsPath): + shutil.rmtree(self.srcAbsPath, ignore_errors=True) + shutil.copytree(self.backupAbsPath, self.srcAbsPath, symlinks=False)