Krinkle has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/57828


Change subject: lint.php: Support file as argument
......................................................................

lint.php: Support file as argument

Change-Id: I1a219faf8dac616f694f1308ca7e789ae8c81350
---
M lint.php
1 file changed, 6 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/tools/code-utils 
refs/changes/28/57828/1

diff --git a/lint.php b/lint.php
index 49e5fae..da063f5 100755
--- a/lint.php
+++ b/lint.php
@@ -53,17 +53,18 @@
 }
 
 if ( isset( $argv[1] ) ) {
-       $dir = $argv[1];
-       if ( !is_dir( $dir ) ) {
-               echo "Not a directory: $dir\n";
+       $path = $argv[1];
+       if ( !file_exists( $path ) ) {
+               echo "Path not found: $path\n";
                exit( 1 );
        }
 } else {
        $dir = '.';
 }
 
-if ( !check_dir( $dir ) ) {
+$ret = is_dir( $path ) ? check_dir( $path ) : check_file( $path );
+if ( !$ret ) {
        exit( 1 );
 } else {
        exit( 0 );
-}
\ No newline at end of file
+}

-- 
To view, visit https://gerrit.wikimedia.org/r/57828
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1a219faf8dac616f694f1308ca7e789ae8c81350
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/tools/code-utils
Gerrit-Branch: master
Gerrit-Owner: Krinkle <ttij...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to