Skip to content

Commit

Permalink
Version 1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
MircoBabin committed Jun 27, 2022
1 parent 7e986f4 commit a7d1ee9
Show file tree
Hide file tree
Showing 11 changed files with 108 additions and 2 deletions.
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Git Credentials via KeePassCommander changelog

## Version 1.3
Release date: 27 jun 2022

* renamed release distribution to GitCredentialsViaKeePassCommander-x.x.zip
* for automatic installation scripts https://github.com/MircoBabin/GitCredentialsViaKeePassCommander/releases/latest/download/release.download.zip.url-location is a textfile and will contain an url to the latest release zip file

## Version 1.2
Release date: 27 nov 2020

* First search in KeePass for title "git [...lowercase last part of directory...][...lowercase computername...]".

## Version 1.1
Release date: 24 sep 2020

* Return %errorlevel%. Errorlevel 1 (and higher) indicates error. Errorlevel 0 is success.

## Version 1.0
Release date: 11 sep 2020

* Initial release
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Download the zip and unpack it in the KeePassCommander directory where KeePassCo

The minimum .NET framework required is 4.0.

*For unattended automatic installation scripts, read the section "Automatic installation scripts" lower down the page.*

# Help

Execute **git-credential-keepasscommand.exe** without parameters to view the help.
Expand Down Expand Up @@ -72,6 +74,14 @@ The default git credential "manager" stores passwords in the Windows Credential

So I build git-credential-keepasscommand.exe which uses KeePassCommander to retrieve credentials from KeePass.

# Automatic installation scripts
For unattended installation scripts the following flow can be used for the latest version:

1) Download https://github.com/MircoBabin/GitCredentialsViaKeePassCommander/releases/latest/download/release.download.zip.url-location
2) Read the text of this file into **latest-download-url**. The file only contains an url, so the encoding is ASCII. *The encoding UTF-8 may also be used to read the file, because ASCII is UTF-8 encoding.*
3) Download the zip from the **latest-download-url** to local file **GitCredentialsViaKeePassCommander.zip**. *Each release carries the version number in the filename. To prevent not knowing the downloaded filename, download to a fixed local filename.*
4) Unpack the downloaded **GitCredentialsViaKeePassCommander.zip** in the KeePassCommander directory where KeePassCommandDll.dll is located.

# Contributions
Contributions are welcome. Please read [CONTRIBUTING.md](CONTRIBUTING.md "contributing") before making any contribution!

Expand Down
Binary file modified assets/KeePassCommandDll.dll
Binary file not shown.
61 changes: 61 additions & 0 deletions assets/Release-build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
@echo off
setlocal
cls

cd /D "%~dp0"

set sz_exe=C:\Program Files\7-Zip\7z.exe
if exist "%sz_exe%" goto build

set sz_exe=C:\Program Files (x86)\7-Zip\7z.exe
if exist "%sz_exe%" goto build

echo !!! 7-Zip 18.06 - 7z.exe not found
pause
goto:eof

:build
echo 7-Zip 18.06: %sz_exe%

FOR /F "tokens=* USEBACKQ" %%g IN (`"%~dp0..\bin\Release\git-credential-keepasscommand.exe" --version`) do (SET GitCredentialsViaKeePassCommanderReleaseVersion=%%g)
FOR /F "tokens=* USEBACKQ" %%g IN (`"%~dp0..\bin\Debug\git-credential-keepasscommand.exe" --version`) do (SET GitCredentialsViaKeePassCommanderDebugVersion=%%g)

if "%GitCredentialsViaKeePassCommanderReleaseVersion%" == "%GitCredentialsViaKeePassCommanderDebugVersion%" goto build_zip
echo.
echo Release version: %GitCredentialsViaKeePassCommanderReleaseVersion%
echo Debug version..: %GitCredentialsViaKeePassCommanderDebugVersion%
echo.
echo !!! Versions do not match.
pause
goto :eof


:build_zip
echo.
echo Release version: %GitCredentialsViaKeePassCommanderReleaseVersion%
echo.
echo.


del /q "Release\*" >nul 2>&1

set files="%~dp0..\bin\Release\git-credential-keepasscommand.exe"
set files=%files% "%~dp0..\bin\Release\git-credential-keepasscommand.exe.config"

"%sz_exe%" a -tzip -mx7 "Release\GitCredentialsViaKeePassCommander-%GitCredentialsViaKeePassCommanderReleaseVersion%.zip" %files%
"%sz_exe%" a -tzip -mx7 "Release\GitCredentialsViaKeePassCommander-%GitCredentialsViaKeePassCommanderReleaseVersion%-debugpack.zip" "%~dp0..\bin"

echo.
echo.
echo Created "Release\GitCredentialsViaKeePassCommander-%GitCredentialsViaKeePassCommanderReleaseVersion%.zip"
echo Created "Release\GitCredentialsViaKeePassCommander-%GitCredentialsViaKeePassCommanderReleaseVersion%-debugpack.zip"

rem https://github.com/MircoBabin/GitCredentialsViaKeePassCommander/releases/latest/download/release.download.zip.url-location
rem Don't output trailing newline (CRLF)
<NUL >"Release\release.download.zip.url-location" set /p="https://github.com/MircoBabin/GitCredentialsViaKeePassCommander/releases/download/%GitCredentialsViaKeePassCommanderReleaseVersion%/GitCredentialsViaKeePassCommander-%GitCredentialsViaKeePassCommanderReleaseVersion%.zip"

echo.
echo Created "Release\release.download.zip.url-location"
echo.

pause
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions assets/Release/release.download.zip.url-location
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://github.com/MircoBabin/GitCredentialsViaKeePassCommander/releases/download/1.3/GitCredentialsViaKeePassCommander-1.3.zip
Binary file removed assets/Release_1.2-debugpack.zip
Binary file not shown.
Binary file removed assets/Release_1.2.zip
Binary file not shown.
4 changes: 2 additions & 2 deletions src/GlobalAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.2.0.0")]
[assembly: AssemblyFileVersion("1.2.0")]
[assembly: AssemblyVersion("1.3.0.0")]
[assembly: AssemblyFileVersion("1.3.0")]
12 changes: 12 additions & 0 deletions src/git-credential-keepasscommand/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ namespace git_credential_keepasscommand
{
class Program
{
private static Version GetVersion()
{
return System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
}

private static ProgramExitCode CredentialHelperCommandGet()
{
//stdin contains input as name = value pairs.
Expand Down Expand Up @@ -96,6 +101,13 @@ static void Main(string[] args)
else
command = "help";

if (args.Length == 1 && args[0].ToLower() == "--version")
{
var version = GetVersion();
Console.Write(version.Major + "." + version.Minor);
return;
}

if (command == "get")
{
exitcode = CredentialHelperCommandGet();
Expand Down

0 comments on commit a7d1ee9

Please sign in to comment.