From 842364636b45f315a0ac975a66326b2c5e46a145 Mon Sep 17 00:00:00 2001 From: bolkun <bolkun@BDV092.slub-dresden.de> Date: Wed, 14 Apr 2021 11:36:03 +0200 Subject: [PATCH] Fixed color print under Win10 without warnings --- README.md | 1 + bin/slubsipbuilderbagit.pl | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e5a672c..b9d2b53 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,7 @@ Using cpanm is recommended for an assisted and clean uninstall. * `cpanm MARC::Record` * `cpanm XML::XPath` * `cpanm DateTime::Format::ISO8601` + * `cpanm Win32::Console::ANSI` 11. All tests must process successfully and you are ready to go with Bag creation. ## Documentation diff --git a/bin/slubsipbuilderbagit.pl b/bin/slubsipbuilderbagit.pl index e6ff95e..c411853 100644 --- a/bin/slubsipbuilderbagit.pl +++ b/bin/slubsipbuilderbagit.pl @@ -540,10 +540,13 @@ package main; #=============================================================================== BEGIN{ + if ($^O eq 'MSWin32') { + require Win32::Console::ANSI; + Win32::Console::ANSI->import(); + } ## no critic $INC{'SLUB/LZA/SIPBuilderBagIt.pm'} = 1; # needed because inlined module ## use critic - use if $^O eq 'MSWin32', Win32::Console::ANSI::; } return 1 if caller; # avoids main code running if module stuff is needed -- GitLab