From 3a54a20af6bdf4290e460ff9675395f9858e65e2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Sat, 8 May 2010 18:09:40 +0000 Subject: [PATCH] Implicitly update config/wiki_pages.yml if it exists, and chmod +x This makes: script/misc/update-wiki-pages from the top-level just work. --- script/misc/update-wiki-pages | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) mode change 100644 => 100755 script/misc/update-wiki-pages diff --git a/script/misc/update-wiki-pages b/script/misc/update-wiki-pages old mode 100644 new mode 100755 index ffb11052e..7cd40e59e --- a/script/misc/update-wiki-pages +++ b/script/misc/update-wiki-pages @@ -42,7 +42,10 @@ Getopt::Long::Parser->new( # On --help help() if $help; -help() unless $ARGV[0]; +my $out_file = $ARGV[0]; +$out_file //= 'config/wiki_pages.yml'; + +help() unless -f $out_file; # Get a API interface my $mw = MediaWiki::API->new(); @@ -73,7 +76,7 @@ for my $lang ('', map { "${_}:" } qw[ Pt Fi De It HU Cz Fr RU Pl ]) { ok(1, "Got a total of $count{$_} ${_}s") for qw[ key value ]; # Dump to .yml file -open my $out, ">", $ARGV[0] or die "Can't open file '$ARGV[0]' supplied on the command line"; +open my $out, ">", $out_file or die "Can't open file '$out_file' supplied on the command line"; say $out "# THIS FILE IS AUTOGENERATED WITH THE script/misc/update-wiki-pages"; say $out "# PROGRAM DO NOT MANUALLY EDIT IT"; say $out ""; -- 2.43.2