Browse Source

Switch from bash to sh for black wrapper.

Dan Helfman 1 month ago
parent
commit
e323290e61
2 changed files with 6 additions and 12 deletions
  1. 4
    10
      scripts/black
  2. 2
    2
      tox.ini

+ 4
- 10
scripts/black View File

@@ -1,13 +1,7 @@
1
-#!/usr/bin/env bash
1
+#!/usr/bin/env sh
2 2
 
3
-set -e
4
-
5
-python_version=$(python --version)
6
-
7
-if [[ "$python_version" =~ "Python 3.5." ]]; then
8
-    echo "Skipping black due to lack of support for $python_version."
9
-elif [[ "$python_version" =~ "Python 3.4." ]]; then
10
-    echo "Skipping black due to lack of support for $python_version."
11
-else
3
+if which black; then
12 4
     black --skip-string-normalization --line-length 100 --check .
5
+else
6
+    echo "Skipping black due to not being installed."
13 7
 fi

+ 2
- 2
tox.ini View File

@@ -5,11 +5,11 @@ skipsdist = True
5 5
 [testenv]
6 6
 usedevelop = True
7 7
 deps = -rtest_requirements.txt
8
-whitelist_externals = bash
8
+whitelist_externals = sh
9 9
 commands =
10 10
     py.test --cov-report term-missing:skip-covered --cov=borgmatic --ignore=tests/end-to-end \
11 11
         tests []
12
-    bash scripts/black
12
+    sh scripts/black
13 13
     flake8 .
14 14
 
15 15
 [testenv:black]

Loading…
Cancel
Save