From be89bfb4380439182d30d4ed007fda8822696dbb Mon Sep 17 00:00:00 2001 From: digimer Date: Thu, 19 Oct 2023 21:36:15 -0400 Subject: [PATCH] Updated striker-get-screenshots to create the screenshot directory. Also fixed a typo in the POD for Storage->make_directory(). Signed-off-by: digimer --- Anvil/Tools/Storage.pm | 2 +- tools/striker-get-screenshots | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Anvil/Tools/Storage.pm b/Anvil/Tools/Storage.pm index 053e8e32..da7491a4 100644 --- a/Anvil/Tools/Storage.pm +++ b/Anvil/Tools/Storage.pm @@ -2744,7 +2744,7 @@ AND This creates a directory (and any parent directories). - $anvil->Storage->make_directory({directory => "/foo/bar/baz", owner => "me", grou[ => "me", group => 755}); + $anvil->Storage->make_directory({directory => "/foo/bar/baz", owner => "me", group => "me", mode => "0755"}); If it fails to create the directory, C<< 1 >> will be returned. Otherwise, C<< 0 >> will be returned. diff --git a/tools/striker-get-screenshots b/tools/striker-get-screenshots index 28b8bc42..a8135f70 100755 --- a/tools/striker-get-screenshots +++ b/tools/striker-get-screenshots @@ -185,6 +185,18 @@ sub check_screenshot_directory { my ($anvil) = @_; + # Does the directory even exist? + if (not -d $anvil->data->{path}{directories}{screenshots}) + { + $anvil->Storage->make_directory({ + debug => 2, + directory => $anvil->data->{path}{directories}{screenshots}, + owner => "striker-ui-api", + group => "striker-ui-api", + mode => "0755", + }); + } + foreach my $directory ($anvil->data->{path}{directories}{opt_alteeve}, $anvil->data->{path}{directories}{screenshots}) { $anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { directory => $directory }});