diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..b179f2a --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Michael Wolf + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/_reformat-common.sh b/_reformat-common.sh index b37724b..171b89f 100644 --- a/_reformat-common.sh +++ b/_reformat-common.sh @@ -21,6 +21,10 @@ function sniff_file_type() { file_type="jsx" elif [[ $ff == *.tsx ]]; then file_type="tsx" + elif [[ $ff == *.css ]] ; then + file_type="css" + elif [[ $ff == *.scss ]] ; then + file_type="scss" elif [[ $ff = *.sh ]]; then file_type="sh" fi diff --git a/do-reformat.sh b/do-reformat.sh index e5ca718..2ba7d23 100755 --- a/do-reformat.sh +++ b/do-reformat.sh @@ -19,6 +19,8 @@ if [[ $file_type == "javascript" || \ $file_type == "html" || \ $file_type == "jsx" || \ $file_type == "tsx" || \ + $file_type == "css" || \ + $file_type == "scss" || \ $file_type == "sh" ]]; then out=$(npx prettier --write $file) retval="$?" diff --git a/would-reformat.sh b/would-reformat.sh index 063ea18..98ae967 100755 --- a/would-reformat.sh +++ b/would-reformat.sh @@ -19,6 +19,8 @@ if [[ $file_type = "javascript" || \ $file_type = "html" || \ $file_type = "jsx" || \ $file_type = "tsx" || \ + $file_type == "css" || \ + $file_type == "scss" || \ $file_type = "sh" ]]; then out=$(npx prettier --check $file 2>&1 >/dev/null) retval="$?"