1

I need to create a run script that will un-zip a file a in the project source code directory and replace the existing files. My requirement in details is like this. I have aa.framework and bb.bundle in a zip file. Zip file is in the source code directory. Now, at the run time (Each time compile the app) I want to up-zip the zip file and replace existing aa.framework file bb.bundle file with the un-zipped files.

Please help me to write a run script to do this if this is doable.

smartsanja
  • 4,413
  • 9
  • 58
  • 106
  • Why does this need doing each build? If it's for security then complex != secure. – trojanfoe Dec 09 '15 at 09:01
  • Actually reason is, when my client download the source code from the svn to a Windows computer, those aa.framework and bb.bundle files get corrupted. I don't know the reason why. So, I want to zip those two files and up-zip then replace at the compilation. – smartsanja Dec 09 '15 at 09:03
  • 1
    Well I'm afraid to say that if files are getting corrupted and no-one knows why, then more problems are on there way. Solve the problem rather than working around it. – trojanfoe Dec 09 '15 at 09:08
  • Let's forget about the corrupted file. I want to know, can we un-zipped a zip file using xcode Run script? – smartsanja Dec 09 '15 at 09:11

1 Answers1

1

You can get the path to to your project from the environment variable PROJECT_DIR. So you just call the zip and unzip commands.

unzip "${PROJECT_DIR}/yourzip.zip"
orkoden
  • 18,946
  • 4
  • 59
  • 50