1
0
mirror of https://github.com/certbot/certbot.git synced 2026-01-26 07:41:33 +03:00
Files
certbot/tools/readlink.py
Brad Warren 962879c35c Remove dependency on git from pip_install.sh. (#4770)
* Remove dependency on git from pip_install.sh.

Using git allowed this file to continue to work even if it was moved to another
directory. This slight increase in robustness wasn't worth it though as it
broke our development Dockerfile (see #4703), the certbot website's Dockerfile
(see certbot/website#226), and our test farm tests (see
certbot/tests/letstest/scripts/test_apache2.sh for an example that calls
tools/venv.sh without installing git). Rather than continuing to find and patch
these things, let's just allow this script to fail if it's moved rather than
propagating the git dependency all over the place.

* Add readlink.py.

This is the equivalent of `readlink -f` on many Linux systems. This is useful
as there are often differences in readlink on different platforms.

* Use readlink.py in pip_install.sh.

This allows us to work around differences in readlink on macOS.
2017-06-05 17:51:45 -07:00

14 lines
320 B
Python
Executable File

#!/usr/bin/env python
"""Canonicalizes a path and follows any symlinks.
This is the equivalent of `readlink -f` on many Linux systems. This is
useful as there are often differences in readlink on different
platforms.
"""
from __future__ import print_function
import os
import sys
print(os.path.realpath(sys.argv[1]))