Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
allow modification of version via hooks
The new internal version-munge command is used to modify the version when read from a version file or when specified on the command line via the shell, local, or global commands. The version stored in a version file is not modified. This allows the user to modify the version dependent upon the existing environment. For example, if the PLENV_ROOT directory is shared across multiple platforms with different OS's, hardware, or ABI's, one could modify the version at run-time to include a platform specific suffix, allowing a single version stored in a version file to accomodate multiple platforms. For example, if the hostname is used to distinguish the platform, e.g. on each host Perl was installed with % plenv install --as 5.22-$(hostname) 5.22 Then with the following hook: % cat ~/.plenv/plenv.d/version-munge/hostname.bash #!/bin/bash if [[ "$version" != --* ]]; then suffix=$(hostname) plenv-prefix "$version-$suffix" 1> /dev/null \ && version="$version-$suffix" fi Setting % plenv global 5.22 will set ~/.plenv/version to 5.22 and the hook will ensure that each host will see its own version.
- Loading branch information