Try to do a few things

FIXME: do them correctly; squash and reword this travesty of a commit.
This commit is contained in:
Michael Wolf
2024-04-03 11:26:50 -06:00
parent 1957698fc4
commit 7c503cecf7
3 changed files with 31 additions and 5 deletions

View File

@@ -1,3 +1,11 @@
function log () {
msg=$@
if [[ ! -z "${LOG_TO+}" ]] ; then
echo "$msg" >> $LOG_TO
fi
}
function get_os() {
un=$(uname)
@@ -139,12 +147,13 @@ function sniff_file_type() {
file_type="css"
elif [[ $ff == *.scss ]]; then
file_type="scss"
elif [[ $ff = *.sh ]]; then
file_type="sh"
elif [[ $ff = *.go ]]; then
file_type="golang"
elif [[ $ff = *.dart ]]; then
elif [[ $ff = *.dart ]]; then
file_type="dart"
elif [[ $ff = *.sh ]]; then
# .sh isn't enough; we'll need other extns
file_type="shell"
elif [[ $ff = *.pl ]]; then
file_type="perl"
elif [[ $ff = *.rs ]] ; then
@@ -186,8 +195,7 @@ function choose_wrapper() {
$file_type = "jsx" ||
$file_type = "tsx" ||
$file_type == "css" ||
$file_type == "scss" ||
$file_type = "sh" ]]; then
$file_type == "scss" ]]; then
out="$WF_ROOT"/./prettier.sh
elif [[ $file_type == "python" ]]; then
out="$WF_ROOT"/./isort-and-black.sh
@@ -197,6 +205,8 @@ function choose_wrapper() {
out="$WF_ROOT"/./rustfmt.sh
elif [[ $file_type == "dart" ]]; then
out="$WF_ROOT"/./dart_format.sh
elif [[ $file_type == "shell" ]] ; then
out="$WF_ROOT"/./shfmt.sh
else
out="$WF_ROOT"/./default.sh
fi