add hook file
This commit is contained in:
		| @@ -1,15 +1,15 @@ | ||||
| UPD 2020-10-28_13:14:54 97618 FHEM/73_AutoShuttersControl.pm | ||||
| UPD 2020-11-09_06:40:13 97618 FHEM/73_AutoShuttersControl.pm | ||||
| UPD 2020-10-23_07:22:10 74159 lib/FHEM/Automation/ShuttersControl.pm | ||||
| UPD 2020-06-22_09:41:40 2657 lib/FHEM/Automation/ShuttersControl/Dev.pm | ||||
| UPD 2020-07-26_17:36:29 2496 lib/FHEM/Automation/ShuttersControl/Roommate.pm | ||||
| UPD 2020-08-12_11:00:05 31376 lib/FHEM/Automation/ShuttersControl/Shutters.pm | ||||
| UPD 2020-10-23_07:22:10 25490 lib/FHEM/Automation/ShuttersControl/Shading.pm | ||||
| UPD 2020-10-23_07:22:10 109907 lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm | ||||
| UPD 2020-11-09_06:40:13 110008 lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm | ||||
| UPD 2020-10-23_07:22:10 45903 lib/FHEM/Automation/ShuttersControl/Helper.pm | ||||
| UPD 2020-06-22_09:41:40 2175 lib/FHEM/Automation/ShuttersControl/Window.pm | ||||
| UPD 2020-07-26_17:36:29 11569 lib/FHEM/Automation/ShuttersControl/Dev/Attr.pm | ||||
| UPD 2020-11-09_06:40:13 11609 lib/FHEM/Automation/ShuttersControl/Dev/Attr.pm | ||||
| UPD 2020-07-03_11:29:10 7251 lib/FHEM/Automation/ShuttersControl/Dev/Readings.pm | ||||
| UPD 2020-10-23_07:22:10 52429 lib/FHEM/Automation/ShuttersControl/Shutters/Attr.pm | ||||
| UPD 2020-11-09_06:40:13 52525 lib/FHEM/Automation/ShuttersControl/Shutters/Attr.pm | ||||
| UPD 2020-06-22_09:41:40 2903 lib/FHEM/Automation/ShuttersControl/Shutters/Readings.pm | ||||
| UPD 2020-06-22_09:41:40 3972 lib/FHEM/Automation/ShuttersControl/Window/Attr.pm | ||||
| UPD 2020-11-09_06:40:13 3980 lib/FHEM/Automation/ShuttersControl/Window/Attr.pm | ||||
| UPD 2020-06-22_09:41:40 2288 lib/FHEM/Automation/ShuttersControl/Window/Readings.pm | ||||
|   | ||||
							
								
								
									
										52
									
								
								hooks/pre-commit
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										52
									
								
								hooks/pre-commit
									
									
									
									
									
										Executable file
									
								
							| @@ -0,0 +1,52 @@ | ||||
| #!/usr/bin/perl -w | ||||
|  | ||||
| use File::Basename; | ||||
| use POSIX qw(strftime); | ||||
| use strict; | ||||
|  | ||||
| my @filenames = (   'FHEM/73_AutoShuttersControl.pm', | ||||
|                     'lib/FHEM/Automation/ShuttersControl.pm', | ||||
|                     'lib/FHEM/Automation/ShuttersControl/Dev.pm', | ||||
|                     'lib/FHEM/Automation/ShuttersControl/Roommate.pm', | ||||
|                     'lib/FHEM/Automation/ShuttersControl/Shutters.pm', | ||||
| 		    'lib/FHEM/Automation/ShuttersControl/Shading.pm', | ||||
| 		    'lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm', | ||||
|                     'lib/FHEM/Automation/ShuttersControl/Helper.pm', | ||||
|                     'lib/FHEM/Automation/ShuttersControl/Window.pm', | ||||
|                     'lib/FHEM/Automation/ShuttersControl/Dev/Attr.pm', | ||||
|                     'lib/FHEM/Automation/ShuttersControl/Dev/Readings.pm', | ||||
|                     'lib/FHEM/Automation/ShuttersControl/Shutters/Attr.pm', | ||||
|                     'lib/FHEM/Automation/ShuttersControl/Shutters/Readings.pm', | ||||
|                     'lib/FHEM/Automation/ShuttersControl/Window/Attr.pm', | ||||
|                     'lib/FHEM/Automation/ShuttersControl/Window/Readings.pm' | ||||
|     ); | ||||
|  | ||||
| my $controlsfile    = 'controls_AutoShuttersControl.txt'; | ||||
|  | ||||
| open(FH, ">$controlsfile") || return("Can't open $controlsfile: $!"); | ||||
|  | ||||
| for my  $filename (@filenames) { | ||||
|     my @statOutput = stat($filename); | ||||
|    | ||||
|     if (scalar @statOutput != 13) { | ||||
|         printf 'error: stat has unexpected return value for ' . $filename . "\n"; | ||||
|         next; | ||||
|     } | ||||
|  | ||||
|     my $mtime = $statOutput[9]; | ||||
|     my $date = POSIX::strftime("%Y-%m-%d", localtime($mtime)); | ||||
|     my $time = POSIX::strftime("%H:%M:%S", localtime($mtime)); | ||||
|     my $filetime = $date."_".$time; | ||||
|  | ||||
|     my $filesize = $statOutput[7]; | ||||
|  | ||||
|     printf FH 'UPD ' . $filetime . ' ' . $filesize . ' ' .$filename . "\n"; | ||||
| } | ||||
|  | ||||
| close(FH); | ||||
|  | ||||
| system("git add $controlsfile"); | ||||
|  | ||||
| print 'Create controls File succesfully' . "\n"; | ||||
|  | ||||
| exit 0; | ||||
		Reference in New Issue
	
	Block a user