Skip to content

Instantly share code, notes, and snippets.

@ferki
Created June 19, 2023 22:00
Show Gist options
  • Select an option

  • Save ferki/7a0e4fd038358562c4c9e8ca5b548d0d to your computer and use it in GitHub Desktop.

Select an option

Save ferki/7a0e4fd038358562c4c9e8ca5b548d0d to your computer and use it in GitHub Desktop.
Preview file changes with Rex
use Rex -feature => [ '1.4', 'exec_autodie' ];
use Rex::Hook::File::Diff; # show diff of file changes by Rex
use if $ENV{PREVIEW}, 'Rex::Hook::File::Impostor'; # use extra hooks if PREVIEW is true
desc 'Demonstrate file preview';
task 'demo', sub {
file '/tmp/rex_file_preview_demo', content => scalar localtime();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment