summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tools/inc/lib/jsgettext/jsgettext.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/inc/lib/jsgettext/jsgettext.php b/tools/inc/lib/jsgettext/jsgettext.php
index 3ce2c9f7..6c70f0b4 100644
--- a/tools/inc/lib/jsgettext/jsgettext.php
+++ b/tools/inc/lib/jsgettext/jsgettext.php
@@ -10,7 +10,7 @@
'-k' => '_'
);
$len = count($args);
- $i = 0;
+ $i = 1;
while ($i < $len) {
if (preg_match('#^-[a-z]$#i', $args[$i])) {
$options[$args[$i]] = isset($args[$i+1]) ? trim($args[$i+1]) : true;
@@ -26,7 +26,11 @@
$options = buildOptions($argv);
- if (!file_exists($options['-o']) || !is_writable($options['-o'])) {
+ if (!file_exists($options['-o'])) {
+ touch($options['-o']);
+ }
+
+ if (!is_writable($options['-o'])) {
die("Invalid output file name. Make sure it exists and is writable.");
}