diff options
author | vvxxp8 | 2020-12-26 15:02:15 +0800 |
---|---|---|
committer | vvxxp8 | 2020-12-26 15:02:15 +0800 |
commit | df28261e3ca608016fddffc10094b4b220718ff3 (patch) | |
tree | a07be8f431d908c78fc0939e0fb68198166fe042 /black_pycharm_formatter.sh | |
parent | de3ff0801f03aca9e7a56a363a7cc0ecbbbab767 (diff) | |
download | aur-df28261e3ca608016fddffc10094b4b220718ff3.tar.gz |
remove ext
Diffstat (limited to 'black_pycharm_formatter.sh')
-rwxr-xr-x | black_pycharm_formatter.sh | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/black_pycharm_formatter.sh b/black_pycharm_formatter.sh index 02c22f1816c2..175bef8a1fca 100755 --- a/black_pycharm_formatter.sh +++ b/black_pycharm_formatter.sh @@ -1,13 +1,15 @@ #!/usr/bin/env bash -case $2 in +file_path=$1 +ext=${file_path##*.} +case $ext in "py") - black -l 80 -S $1 + black -l 80 -S $file_path ;; "ipynb") - jupytext $1 --pipe "black -l 80 -S {}" + jupytext $file_path --pipe "black -l 80 -S {}" ;; "sh") - shfmt -w $1 + shfmt -w $file_path ;; esac |