Rex::Hook::File::Impostor - execute Rex file management commands on a copy of the managed path
version v0.2.0
use Rex::Hook::File::Impostor;
This module makes Rex execute file management commands on a copy of the managed path instead of the original one.
This could be particularly useful when it is loaded conditionally to be combined with other modules. For example together with Rex::Hook::File::Diff, it could be used to show a diff of file changes without actually changing the original file contents.
It works by installing a before hook for file commands, which makes a copy of the original file into a temporary directory, and then overrides the original arguments of the file commands.
This module does not do any error checking (yet).
It uses the same temporary directory that is used by Rex. Therefore it can be configured with set_tmp_dir:
Rex::Config->set_tmp_dir($tmp_dir);
This module does not use any environment variables.
See the included cpanfile
.
There are no known incompatibilities with other modules.
There are no known bugs. Make sure they are reported.
Ferenc Erki <erkiferenc@gmail.com>
This software is Copyright (c) 2020-2022,2024 by Ferenc Erki.
This is free software, licensed under:
The GNU Lesser General Public License, Version 3, June 2007
Early versions of this software were sponsorware. Thanks to GitHub sponsors, it is now available to everyone!