Start extracting language-specific formatters
This commit is contained in:
@@ -5,12 +5,20 @@ IFS=$'\n\t'
|
||||
|
||||
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
source "$DIR/_reformat-common.bash"
|
||||
|
||||
wrflog asdf asdf asdf
|
||||
|
||||
file="$1"
|
||||
|
||||
source "$DIR/_reformat-common.sh"
|
||||
## fixme use realpath or something on "$file"
|
||||
|
||||
|
||||
|
||||
file_type=$(sniff_file_type $file)
|
||||
|
||||
wrflog got file_type $file_type
|
||||
|
||||
if [[ $file_type = "javascript" || \
|
||||
$file_type = "vue" || \
|
||||
$file_type = "typescript" || \
|
||||
@@ -22,7 +30,10 @@ if [[ $file_type = "javascript" || \
|
||||
$file_type == "css" || \
|
||||
$file_type == "scss" || \
|
||||
$file_type = "sh" ]]; then
|
||||
out=$(npx prettier --check $file 2>&1 >/dev/null)
|
||||
wrflog will run thing
|
||||
wrflog "$(wfroot $DIR)"
|
||||
wrflog "prettier: $(ls -l $(wfroot $DIR)/./prettier.sh)"
|
||||
out=$(WOULD_REFORMAT=would_reformat $(wfroot $DIR)/./prettier.sh $file 2>&1 > /dev/null)
|
||||
retval="$?"
|
||||
success_retval=0
|
||||
would_reformat_retval=1
|
||||
|
||||
Reference in New Issue
Block a user