Skip to content

Instantly share code, notes, and snippets.

@campbellwmorgan
Created November 29, 2016 10:00
Show Gist options
  • Save campbellwmorgan/d4384a6e287c19716203d3190b1a1cfb to your computer and use it in GitHub Desktop.
Save campbellwmorgan/d4384a6e287c19716203d3190b1a1cfb to your computer and use it in GitHub Desktop.
#!/bin/bash
# Changes all spaces to tabs in a javscript project
# run at project root
files=`find . -path ./node_modules -prune -o -name "*.js"`
for file in $files; do
echo "Processing $file"
cat "$file" | unexpand -t 2 > "$file.new"
rm -f "$file"
mv "$file.new" "$file"
done
echo "Complete"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment