You appear to be a bot. Output may be restricted
Description
Check the status of all the sub-folders in the directoryList each sub-directory If it's a git directory check the status
Usage
Git::check_status( $directory );
Parameters
- $directory
- ( string ) required –
Returns
voidSource
File name: oik-batch/includes/class-git.phpLines:
1 to 33 of 33
function check_status( $directory ) { $this->echo( "Looking for Git repos in $directory" . PHP_EOL ); $files = scandir( $directory ); foreach ( $files as $file ) { if ( $file != "." && $file !== ".." && $file !== ".git" ) { if ( is_dir( $file ) ) { $this->echo( "$file is a directory" . PHP_EOL ); $source = $this->is_git( $directory . "/" . $file ); if ( $source ) { // Can't quite remember what this next line's purpose was. //echo "git clone https://github.com/bobbingwide/$file" . PHP_EOL; chdir( $source ); $result = $this->command( "status", null ); $this->echo( $result ); $this->echo( PHP_EOL ); if ( $result ) { oikb_get_response( "Continue?", true ); } } else { $this->echo( "$source is not a git folder" . PHP_EOL ); } chdir( $directory ); } else { //echo "$file is not a directory"; } } } }View on GitHub