File: format-js.sh

package info (click to toggle)
js-of-ocaml 4.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 7,372 kB
  • sloc: ml: 70,468; javascript: 8,238; ansic: 319; makefile: 217; lisp: 23; sh: 6; perl: 4
file content (9 lines) | stat: -rwxr-xr-x 313 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
#!/bin/bash

echo "# Removing tabs"
find ./ -regex "^\.\(/[a-zA-Z0-9_-.]*\)*\.js" -exec sed -i 's/	//g' {} \;

echo "# Indent files"
SCRIPT=$(readlink -f $0)
SCRIPTPATH=`dirname $SCRIPT`
find ./ -regex "^\.\(/[a-zA-Z0-9_-.]*\)*\.js" -exec emacs -batch {} -l ${SCRIPTPATH}/emacs-format-js.el -f emacs-format-js \;