File: portable_realpath

package info (click to toggle)
btllib 1.7.5%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,336 kB
  • sloc: cpp: 79,742; python: 941; sh: 302; makefile: 5
file content (8 lines) | stat: -rw-r--r-- 234 bytes parent folder | download
1
2
3
4
5
6
7
8
#!/bin/bash

set -euo pipefail

# MacOS does not necessarily have coreutils installed, but Python should be as btllib requires it
function portable_realpath() {
  python3 -c 'import os, sys; print(os.path.realpath(sys.argv[1]))' $1
}