lagergren@1036: #!/bin/bash lagergren@1036: # lagergren@1036: # Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. lagergren@1036: # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. lagergren@1036: # lagergren@1036: # This code is free software; you can redistribute it and/or modify it lagergren@1036: # under the terms of the GNU General Public License version 2 only, as lagergren@1036: # published by the Free Software Foundation. lagergren@1036: # lagergren@1036: # This code is distributed in the hope that it will be useful, but WITHOUT lagergren@1036: # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or lagergren@1036: # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License lagergren@1036: # version 2 for more details (a copy is included in the LICENSE file that lagergren@1036: # accompanied this code). lagergren@1036: # lagergren@1036: # You should have received a copy of the GNU General Public License version lagergren@1036: # 2 along with this work; if not, write to the Free Software Foundation, lagergren@1036: # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. lagergren@1036: # lagergren@1036: # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA lagergren@1036: # or visit www.oracle.com if you need additional information or have any lagergren@1036: # questions. lagergren@1036: # lagergren@1036: lagergren@1036: fix() { lagergren@1036: #convert tabs to spaces lagergren@1036: find . -name $1 -exec sed -i "" 's/ / /g' {} \; lagergren@1036: #remove trailing whitespace lagergren@1036: find . -name $1 -exec sed -i "" 's/[ ]*$//' \{} \; lagergren@1036: } lagergren@1036: lagergren@1036: if [ ! -z $1 ]; then lagergren@1036: fix $1; lagergren@1036: else lagergren@1036: fix "*.java" lagergren@1036: fix "*.js" lagergren@1036: fi