We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f7e5930 commit e82f1e4Copy full SHA for e82f1e4
bin/utils
@@ -58,3 +58,30 @@ measure-size() {
58
echo "$(du -s .heroku/python 2>/dev/null || echo 0) | awk '{print $1}')"
59
}
60
61
+# Python version operator >
62
+version_gt() {
63
+ test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1";
64
+}
65
+
66
+# Python verison operator >=
67
+version_gte() {
68
+ if [ "$1" == "$2" ]; then
69
+ return 0
70
+ fi
71
72
+ version_gt "$1" "$2"
73
74
75
+# Check if Python 2
76
+python2_check() {
77
+ VERSION="$1"
78
79
+ version_gte "$VERSION" "python-2.7.0" && version_gt "python-3.0.0" "$VERSION"
80
81
82
+# Check if Python 3
83
+python3_check() {
84
85
86
+ version_gte "$VERSION" "python-3.0.0" && version_gt "python-4.0.0" "$VERSION"
87
0 commit comments