55 * Provides consistent logging, file operations, and tool detection
66 */
77
8- import { $ , chalk , fs , path } from 'zx'
8+ import { $ , chalk , fs , path , ProcessOutput } from 'zx'
99
1010// Configure zx behavior
1111$ . verbose = false
@@ -26,7 +26,10 @@ interface RunOptions {
2626 * @param command Array of command parts
2727 * @param options Execution options
2828 */
29- export async function runWithRunner ( command : string [ ] , options : RunOptions = { } ) : Promise < any > {
29+ export async function runWithRunner (
30+ command : string [ ] ,
31+ options : RunOptions = { } ,
32+ ) : Promise < ProcessOutput > {
3033 const { quiet = false } = options
3134
3235 // Log command execution if not quiet
@@ -73,7 +76,7 @@ export async function getStagedPhpFiles(): Promise<string[]> {
7376 // Filter for PHP files that actually exist
7477 const phpFiles : string [ ] = [ ]
7578 for ( const file of allFiles ) {
76- if ( file . endsWith ( '.php' ) && ! file . includes ( '/ vendor/') && ( await fs . pathExists ( file ) ) ) {
79+ if ( file . endsWith ( '.php' ) && ! file . startsWith ( ' vendor/') && ( await fs . pathExists ( file ) ) ) {
7780 phpFiles . push ( file )
7881 }
7982 }
@@ -180,7 +183,7 @@ export async function hasComposerPackage(packageName: string): Promise<boolean>
180183 * @param toolName Name of the tool
181184 * @param args Arguments to pass to the tool
182185 */
183- export async function runVendorBin ( toolName : string , args : string [ ] = [ ] ) : Promise < any > {
186+ export async function runVendorBin ( toolName : string , args : string [ ] = [ ] ) : Promise < ProcessOutput > {
184187 const command = [ `./vendor/bin/${ toolName } ` , ...args ]
185188 return await runWithRunner ( command )
186189}
0 commit comments