The code-clean.sh script will corrupt any binary files that do not have one of the following in their name :
".psp", ".gif", ".jpg", ".png", ".tgz", ".ico", "druplicon"
So, this script will currupt swf, mp3, etc.
This wouldn't be so bad if the script actually explained what it did. I presume the last two lines convert dos text files to unix ones.
Wouldn't a better solution be to use the 'file' command to determine which files are text?
Jonny
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | document-code-clean-sh-118177-9.patch | 1.06 KB | Tor Arne Thune |
| #4 | 118177-document-code-clean-sh.patch | 1.38 KB | brianV |
Comments
Comment #1
brianV commentedThis file removes temporary files left by editors. It also does some minor code cleanup by removing extraneous spaces, and converting tab characters into two space.
It is a script meant for developers. It's not meant to be run on a production site with anything other than core files.
I would recommend this file get pulled from release versions of Drupal.
Comment #3
Daniel Norton commentedIt should be clearly and accurately documented, else it should be deleted.
Comment #4
brianV commentedPatch attached that adds some documentation and a warning to code-clean.sh.
Comment #5
brianV commentedComment #6
drifter commentedCertainly an improvement, the comments make the purpose of the script much clearer.
Comment #7
webchickWell if you're going to put a BIG SCARY COMMENT in there, can you at least qualify why this is? The knowledge from this issue should be transferred into the comments.
Also, I'd like to see a reference to Coder module in here, as that is actually community-maintained.
Comment #8
grendzy commentedWe could also consider moving this functionality into coder or drush projects, and remove the script from core. (code-style.pl has already been removed, and there seems to be some overlap here) #340940: code-style.pl should be removed from core
The editor / patch file removal is useful, I actually use the first half of that script. But the white space removal just seems like a nuisance (I use coder and eclipse for that).
Comment #9
Tor Arne Thune commentedJust a reroll of the patch in #4.
Comment #10
marvil07 commentedcode-clean.sh was removed from core some time ago #1282524: Remove scripts/code-clean.sh