Debian Codegraph @

libexec/pyenv-version-file-write

raw symbols SCIP
1 #!/usr/bin/envscip-shell filesystem . . `/usr/bin/env`. bash
2 # Usage: pyenv version-file-write [-f|--force] <file> <version> [...]
3 #
4 # -f/--force Don't verify that the versions exist
5
6 set -e
7 [scip-shell system . . `[`. -n "$PYENV_DEBUG" ] && set -x
8
9 while [[ $# -gt 0 ]]
10 do
11 case "$1" in
12 -f|--force)
13 FORCE=1
14 shift
15 ;;
16 *)
17 break
18 ;;
19 esac
20 done
21
22
23 PYENV_VERSION_FILE="$1"
24 shift || truescip-shell system . . true.
25 versions=("$@")
26
27 if [scip-shell system . . `[`. -z "$versions" ] || [scip-shell system . . `[`. -z "$PYENV_VERSION_FILE" ]; then
28 pyenv-help --usage version-file-write >&2
29 exit 1
30 fi
31
32 # Make sure the specified version is installed.
33 [[ -z $FORCE ]] && pyenv-prefix "${versions[@]}" >/dev/nullscip-shell filesystem . . `/dev/null`.
34
35 # Write the version out to disk.
36 # Create an empty file. Using "rm" might cause a permission error.
37 > "$PYENV_VERSION_FILE"
38 for version in "${versions[@]}"; do
39 echoscip-shell system . . echo. "$version" >> "$PYENV_VERSION_FILE"
40 done