From 3a4bd75be002c79ae2ba3f68b62598dc1ef7d93f Mon Sep 17 00:00:00 2001 From: Petter Reinholdtsen Date: Fri, 16 Feb 2018 07:07:13 +0000 Subject: [PATCH] Avoid hardcoding po file name. --- fixup-migrate-gettext.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) mode change 100644 => 100755 fixup-migrate-gettext.rb diff --git a/fixup-migrate-gettext.rb b/fixup-migrate-gettext.rb old mode 100644 new mode 100755 index 9bb7ec8..eb255da --- a/fixup-migrate-gettext.rb +++ b/fixup-migrate-gettext.rb @@ -58,5 +58,7 @@ class PoStr end end -file = 'po/es/mwcc.po' +raise ArgumentError, 'Source file not specified' if ARGV.size != 1 +file = ARGV[0] strings = File.open(file,'r').read.split(/\n\n/)[1..-1].map {|str| PoStr.new(str)} +print strings -- 2.47.2