diff --git a/Sources/XcodeGenCLI/Commands/GenerateCommand.swift b/Sources/XcodeGenCLI/Commands/GenerateCommand.swift index 8ae7ba86..d03dd3ac 100644 --- a/Sources/XcodeGenCLI/Commands/GenerateCommand.swift +++ b/Sources/XcodeGenCLI/Commands/GenerateCommand.swift @@ -39,6 +39,11 @@ class GenerateCommand: ProjectCommand { let projectPath = projectDirectory + "\(project.name).xcodeproj" + // run pre gen command before we use the cache as the scrips may change it + if let command = project.options.preGenCommand { + try Task.run(bash: command, directory: projectDirectory.absolute().string) + } + let cacheFilePath = self.cacheFilePath ?? Path("~/.xcodegen/cache/\(projectSpecPath.absolute().string.md5)").absolute() var cacheFile: CacheFile? @@ -69,11 +74,6 @@ class GenerateCommand: ProjectCommand { } } - // run pre gen command - if let command = project.options.preGenCommand { - try Task.run(bash: command, directory: projectDirectory.absolute().string) - } - // validate project do { try project.validateMinimumXcodeGenVersion(version)