-
-
Save manuelgeek/69b83a1f8cb039a077dd9c398477eac3 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 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