Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
heroku-buildpack-python
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Evili del Rio
heroku-buildpack-python
Commits
e82f1e4d
Unverified
Commit
e82f1e4d
authored
Jul 13, 2018
by
Terence Lee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add Python version operators
parent
f7e59300
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
bin/utils
bin/utils
+27
-0
No files found.
bin/utils
View file @
e82f1e4d
...
...
@@ -58,3 +58,30 @@ measure-size() {
echo
"
$(
du
-s
.heroku/python 2>/dev/null
||
echo
0
)
| awk '{print
$1
}')"
}
# Python version operator >
version_gt
()
{
test
"
$(
printf
'%s\n'
"
$@
"
|
sort
-V
|
head
-n
1
)
"
!=
"
$1
"
;
}
# Python verison operator >=
version_gte
()
{
if
[
"
$1
"
==
"
$2
"
]
;
then
return
0
fi
version_gt
"
$1
"
"
$2
"
}
# Check if Python 2
python2_check
()
{
VERSION
=
"
$1
"
version_gte
"
$VERSION
"
"python-2.7.0"
&&
version_gt
"python-3.0.0"
"
$VERSION
"
}
# Check if Python 3
python3_check
()
{
VERSION
=
"
$1
"
version_gte
"
$VERSION
"
"python-3.0.0"
&&
version_gt
"python-4.0.0"
"
$VERSION
"
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment