0

I am using IBM Worklight 6.1 and trying to copy a file into iphone/native/www/worklight folder The file I am trying to copy/erase is cordova_plugins.js, For that purpose I edited the buildtime.sh shell script by adding the line:

cp "${SRCROOT}/cordova_plugins.js" "${SRCROOT}/www/default/worklight/cordova_plugins.js"

This does not work after deploying for iPhone, and returns a permission denied error. After unlocking the file cordova_plugins.js (manually), the script works without errors.

So, I tried to unlock the file with the same script shell, by adding

chflags nouchg "${SRCROOT}/www/default/worklight/cordova_plugins.js"

just before the cp instruction, but It does not seems to change anything (no additional error, but the issue remains the same.)

Is there a way to unlock the /www/worklight files in project settings or programatically? How to do that with my buildtime.sh script ? Any other workaround?

WiPhone
  • 683
  • 6
  • 24

1 Answers1

0

In Worklight, this file was not meant to be played around with (per our discussion in another question of yours).

To work around it, try this:
Go to Xcode preferences and unlock all files by selecting the "Automatically unlock files" option.

enter image description here

Idan Adar
  • 44,156
  • 13
  • 50
  • 89
  • Thanks but this is not what I am looking for : in this way it will be only working on my mac, and if someone else get the code from source control, he must change this too, or get the error – WiPhone May 17 '14 at 10:34
  • Understood, but you asked for a workaround and this is a valid workaround your co-workers can do as well, until you find a way to make it work using a script. ;) – Idan Adar May 17 '14 at 10:35
  • Also, if you ever re-generate your Worklight project, this file may be overwritten, so your script change will be lost. So it is better to do this outside of the Worklight project, and via Xcode sounds much better in this case. – Idan Adar May 17 '14 at 10:36
  • By the way, I think that buildtime.sh script is executed after copying resources to the binary file, since my wokaround works only the second time I run the projet for now. Is there a way to execute pre-build script ? – WiPhone May 17 '14 at 10:38
  • Maybe there is some Xcode option to add scripts and call them at specific times. I don't know, try googling for that. – Idan Adar May 17 '14 at 10:39
  • @WiPhone, if my answer helped resolve your problem, please mark as answered. – Idan Adar Sep 06 '14 at 16:16