mde/utilities — pull request #15 by bryanmacfarlane (2014-02-18 00:57:56+00:00)
Title: rmRf silently failing on readonly file in windows

I was using it on Macs fine for awhile and today on windows, I noticed the it was silently failing. I added some tracing and noticed it was failing on fs.unlink. I wrote a separate script with node shelljs and it worked. The difference is they best effort try to chmod on unlink failure (see below).

rm -rf _install
remove:_install
remove:_install\working
remove:_install\working\defId
remove:_install\working\defId\repo
remove:_install\working\defId\repo\.git
remove:_install\working\defId\repo\.git\objects
remove:_install\working\defId\repo\.git\objects\02
isFile:true
unlink!
{ [Error: EPERM, operation not permitted 'C:\Users\bryanmac\Projects\xxxx\host\_install\working\defId\repo
\.git\objects\02\37597b848a1890bb30ba0ff4102f8107cafdcb']
errno: 50,
code: 'EPERM',
path: 'C:\\Users\\bryanmac\\Projects\\xxxx\\host\\_install\\working\\defId\\repo\\.git\\objects\\02\\37
597b848a1890bb30ba0ff4102f8107cafdcb',
syscall: 'unlink' }