From a2cba5fd39bb6d154e019bb2c8a40cd7e114577b Mon Sep 17 00:00:00 2001
From: bolkun <bolkun@BDV092.slub-dresden.de>
Date: Wed, 14 Apr 2021 11:21:25 +0200
Subject: [PATCH] Fixed colorful print in Win10

---
 README.md                  | 4 +---
 bin/slubsipbuilderbagit.pl | 1 +
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/README.md b/README.md
index d1c696d..e5a672c 100644
--- a/README.md
+++ b/README.md
@@ -56,9 +56,7 @@ Using cpanm is recommended for an assisted and clean uninstall.
     * `cpanm MARC::Record`
     * `cpanm XML::XPath`
     * `cpanm DateTime::Format::ISO8601`
-11. All tests must process successfully and you are ready to go with Bag creation
-12. If colors on console not visible, than add line `use Win32::Console::ANSI` in file `SLUB_SIP-Builder/bin/slubsipbuilderbagit.pl` above `use Term::ANSIColor;`
-    * `cpanm Win32::Console::ANSI`
+11. All tests must process successfully and you are ready to go with Bag creation.
 
 ## Documentation
 * Project based on BagIt 1.0 specification, visit [RFC8493](https://tools.ietf.org/html/rfc8493) 
diff --git a/bin/slubsipbuilderbagit.pl b/bin/slubsipbuilderbagit.pl
index 5d99a91..e6ff95e 100644
--- a/bin/slubsipbuilderbagit.pl
+++ b/bin/slubsipbuilderbagit.pl
@@ -543,6 +543,7 @@ BEGIN{
     ## 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