Created
May 4, 2019 20:43
-
-
Save bahodge/d41d93a8fc9f5fd2fa208788c2315672 to your computer and use it in GitHub Desktop.
Find or Create .formatter.exs script that makes one in the current directory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
current=$(pwd) | |
formatter_file=".formatter.exs" | |
echo $current | |
if [ -e $current/"$formatter_file" ]; | |
then | |
mix format | |
echo "Formatting Complete" | |
else | |
echo "Creating .formatter.exs" | |
touch $current/.formatter.exs | |
echo '[inputs: ["{mix,.formatter}.exs", "./**/*.{ex,exs}"]]' > $current/.formatter.exs | |
mix format | |
echo "Formatting Complete" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment