Skip to content

Instantly share code, notes, and snippets.

@MattiSG
Last active December 22, 2015 10:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MattiSG/6462784 to your computer and use it in GitHub Desktop.
Save MattiSG/6462784 to your computer and use it in GitHub Desktop.
Upgrade Watai from 0.5 to 0.6 syntax
#!/bin/bash
# Partially upgrades Watai tests from v0.5 syntax to v0.6
# Removes enclosing curly braces from Feature and Widget files
IFS=$(echo -en "\n\b")
for file in $(find -E "$1" -regex ".*(Feature|Widget)\.js$" -type f)
do
mv "$file" "$file~"
grep -v '^[{}]$' "$file~" | sed 's:^ ::g' > "$file"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment