source: tools/format_code.sh

Last change on this file was 816, checked in by chronos, 9 years ago
  • Modified: Tabs converted to spaces.
  • Modified: Remove spaces from end of lines.
  • Added: Code format script.
  • Property svn:executable set to *
File size: 289 bytes
Line 
1#!/bin/bash
2
3# Convert tabs to spaces
4find . -name '*.php' ! -type d -exec bash -c 'expand -t 2 "$0" > /tmp/e && mv /tmp/e "$0"' {} \;
5
6# Remove trailing spaces
7find . -type f -name "*.php" -exec sh -c 'for i;do sed 's/[[:space:]]*$//' "$i">/tmp/.$$ && cat /tmp/.$$ > "$i";done' arg0 {} +
Note: See TracBrowser for help on using the repository browser.