File tree 1 file changed +13
-5
lines changed
1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -11,12 +11,20 @@ echo PHP_EOL.
11
11
' |_| ' .PHP_EOL .PHP_EOL .
12
12
'=========================================================== ' .PHP_EOL .PHP_EOL ;
13
13
14
- if (file_exists ($ sComposerAutoloader = __DIR__ .'/../vendor/autoload.php ' )){
15
- require $ sComposerAutoloader ;
14
+ $ sComposerAutoloaderWorkingDirectory = getcwd () . '/vendor/autoload.php ' ;
15
+ if (is_file ($ sComposerAutoloaderWorkingDirectory )) {
16
+ require_once $ sComposerAutoloaderWorkingDirectory ;
16
17
}
17
- else {
18
- printError ('Composer autoload file " ' .$ sComposerAutoloader .'" does not exist ' );
19
- exit (1 );
18
+
19
+ if (!class_exists ('CssLint\Linter ' , true )) {
20
+ // consider being in bin dir
21
+ $ sComposerAutoloader = __DIR__ . '/../vendor/autoload.php ' ;
22
+ if (!is_file ($ sComposerAutoloader )) {
23
+ // consider being in vendor/neilime/php-css-lint/scripts
24
+ $ sComposerAutoloader = __DIR__ . '/../../../autoload.php ' ;
25
+ }
26
+
27
+ require_once $ sComposerAutoloader ;
20
28
}
21
29
22
30
function printUsage (){
You can’t perform that action at this time.
0 commit comments