Does index.html have to be writable?

A bizarre error has popped up this morning trying to do a build. If I check in using Emacs with RCS (I know, I know, I’m an old coder and hate git), index.html on my app, when I do an Ionic build IOS I get the following error:

ionic build ios
Running command: /Users/rwillett/Documents/src/Jambuster/hooks/after_prepare/010_add_platform_class.js /Users/rwillett/Documents/src/Jambuster
net.js:624
throw new TypeError(‘invalid data’);
^
TypeError: invalid data
at Socket.write (net.js:624:11)
at Object. (/Users/rwillett/Documents/src/Jambuster/hooks/after_prepare/010_add_platform_class.js:90:22)
at Module._compile (module.js:460:26)
at Object.Module._extensions…js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
at node.js:814:3
Error: Hook failed with error code 1: /Users/rwillett/Documents/src/Jambuster/hooks/after_prepare/010_add_platform_class.js
at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:194:23
at _rejected (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:797:24)
at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:823:30
at Promise.when (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:1035:31)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:741:41)
at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:557:44
at flush (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:108:17)
at process._tickCallback (node.js:355:11)

When I check out index.html it builds correctly with no error. I have pulled out all the RCS tag information and diffed the two files after check-in and check-out and they are the same.

e.g.

Robs-Mac-Pro:www rwillett$ cp index.html ,t1 <-- This is the checked in version
Robs-Mac-Pro:www rwillett$ emacs index.html <-- I check it out here
Robs-Mac-Pro:www rwillett$ diff index.html ,t1 <-- I diff the two. No differences at all.
Robs-Mac-Pro:www rwillett$ ionic build ios <-- This works.

Robs-Mac-Pro:www rwillett$ ls -l index.html
-rw-r–r-- 1 rwillett staff 2208 3 Mar 14:40 index.html <-- The checked out version which builds correctly.

I use emacs, check it in to RCS (stop sniggering at the back)

Robs-Mac-Pro:www rwillett$ !ls
ls -l index.html
-r–r--r-- 1 rwillett staff 2208 3 Mar 14:43 index.html <-- The checked in version which fails.

My system is a Mac OS X Yosemite 10.10.2

Robs-Mac-Pro:www rwillett$ cordova --version
4.2.0

Robs-Mac-Pro:www rwillett$ ionic info

Your system information:

OS: Mac OS X Yosemite
Node Version: v0.12.0
Cordova CLI: 4.2.0
Ionic CLI Version: 1.3.11
Xcode version: Xcode 6.1.1 Build version 6A2008a
ios-sim version: Not installed

The only difference I can see is that index.html doesn’t have write permissions for user.

Easy workaround, check out index.html before a build but I’ve spent the best part of eight hours to find this and I’d love to know if there’s a reason. I have uninstalled, reinstalled node.js, cordova, iOS, plugins, ionic, gone through with jshint every js file, and then came down to this index.html file and even now still have no idea whats why its happening.

For my own sanity I’d be grateful if somebody can give me a clue as to whats happening.

Thanks,

Rob.