add pre-commit hook and README.md

This commit is contained in:
Marko Oldenburg 2021-04-20 19:54:30 +02:00
parent 1933241a98
commit ece5296381
3 changed files with 54 additions and 0 deletions

16
README.md Normal file
View File

@ -0,0 +1,16 @@
# FHEM::Core::Password::Utils
## Used branching model
* Master branch: Production version (copy of [fhem/fhem-mirror/blob/master/fhem/lib/FHEM/Core/Password/Utils.pm](https://github.com/fhem/fhem-mirror/blob/master/fhem/lib/FHEM/Core/Password/Utils.pm))
* Devel branch: Latest development version
## Community support
The FHEM Forum is available [here](https://forum.fhem.de/) for general support.
In case you have a specific question about this module, it is recommended to find the right sub-forum.
It can either be found from the module info card using the FHEM Installer (e.g. using command `search <MODULE_NAME>`) or it can be determined from the [MAINTAINER.txt](https://github.com/fhem/fhem-mirror/blob/master/fhem/MAINTAINER.txt) file.
## Bug reports and feature requests
Identified bugs and feature requests are tracked using [Github Issues](https://github.com/fhem/mod-Password/issues).
## Pull requests / How to participate into development
You are invited to send pull requests to the devel branch whenever you think you can contribute with some useful improvements to the module. The module maintainer will review you code and decide whether it is going to be part of the module in a future release.

View File

@ -0,0 +1 @@
UPD 2021-04-20_19:18:02 4627 lib/FHEM/Core/Password/Utils.pm

37
hooks/pre-commit Executable file
View File

@ -0,0 +1,37 @@
#!/usr/bin/perl -w
use File::Basename;
use POSIX qw(strftime);
use strict;
my @filenames = ('lib/FHEM/Core/Password/Utils.pm');
my $controlsfile = 'controls_passwordUtils.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;