diff --git a/Git/192.168.0.73.bat b/Git/192.168.0.73.bat index d5e3e28..979361c 100644 --- a/Git/192.168.0.73.bat +++ b/Git/192.168.0.73.bat @@ -1,12 +1,11 @@ -echo off -L: -cd L:\Git -mkdir "%1.git" -cd "%1.git" +@echo off +G: +mkdir "%~1.git" +cd "%~1.git" git init --bare git config core.logAllRefUpdates "true" cd .. -echo Use WinSCP to copy (okay to keep) the %1.git directory to /srv/git. Then click return when done +echo Use WinSCP to copy (okay to keep) the %~1.git directory to /srv/git. Then click return when done @pause echo sudo -i echo 4hink @@ -16,22 +15,23 @@ echo exit echo exit echo Run the above command in putty. Then click return when done "C:\Program Files\PuTTY\putty.exe" -ssh unity4@192.168.0.73 -pw 4hink -git clone git@192.168.0.73:/srv/git/%1.git -cd "%1" -copy "L:\Git\VS-Code-Settings\Visual Studio Settings\.editorconfig" "L:\Git\%1\.editorconfig" -dotnet new gitignore -dotnet new tool-manifest +git clone git@192.168.0.73:/srv/git/%~1.git +y "G:\VS-Code-Settings\Visual Studio Settings\.editorconfig" "G:\%~1\.editorconfig" +dotnet new gitignore --force +dotnet new tool-manifest --force dotnet tool install Husky dotnet tool restore dotnet husky install -dotnet husky add pre-commit -echo {"scripts": {}}>package.json +REM dotnet husky add pre-commit +copy "G:\VS-Code-Settings\Git\pre-commit" "G:\%~1\.husky\pre-commit" +copy "G:\VS-Code-Settings\Git\task-runner.json" "G:\%~1\.husky\task-runner.json" +copy "G:\VS-Code-Settings\Git\package.json" "G:\%~1\package.json" git add . git commit -m "Initial Commit" git push origin master git fetch git push -u origin master -git remote add mestsa003 "\\mestsa003.infineon.com\Git\%1.git" +git remote add mestsa003 "\\mestsa003.infineon.com\Git\%~1.git" git push mestsa003 master code . exit \ No newline at end of file diff --git a/Git/Create-Shortcut.vbs b/Git/Create-Shortcut.vbs new file mode 100644 index 0000000..01a2cf5 --- /dev/null +++ b/Git/Create-Shortcut.vbs @@ -0,0 +1,6 @@ +Set oWS = WScript.CreateObject("WScript.Shell") +sLinkFile = "mestsa003 - " + WScript.Arguments.Item(0) + ".lnk" +Set oLink = oWS.CreateShortcut(sLinkFile) +oLink.TargetPath = "G:\VS-Code-Settings\Git\mestsa003.bat" +oLink.Arguments = WScript.Arguments.Item(0) +oLink.Save \ No newline at end of file diff --git a/Git/mestsa003.bat b/Git/mestsa003.bat index bd90faf..becfd23 100644 --- a/Git/mestsa003.bat +++ b/Git/mestsa003.bat @@ -1,27 +1,27 @@ -L: -cd L:\Git -mkdir "%1.git" -cd "%1.git" +@echo off +G: +mkdir "%~1.git" +cd "%~1.git" git init --bare git config core.logAllRefUpdates "true" cd .. -robocopy /E /MOVE "%1.git" "\\mestsa003.infineon.com\Git\%1.git" -cd "%1" +robocopy /E "%~1.git" "\\mestsa003.infineon.com\Git\%~1.git" +cd "%~1" git init git rev-parse --git-dir git fetch git remote --verbose -git config --get commit.template -git config --local branch.master.github-pr-owner-number -git remote add origin "\\mestsa003.infineon.com\Git\%1.git" -copy "L:\Git\VS-Code-Settings\Visual Studio Settings\.editorconfig" "L:\Git\%1\.editorconfig" -dotnet new gitignore -dotnet new tool-manifest +git remote add origin "\\mestsa003.infineon.com\Git\%~1.git" +copy "G:\VS-Code-Settings\Visual Studio Settings\.editorconfig" "G:\%~1\.editorconfig" +dotnet new gitignore --force +dotnet new tool-manifest --force dotnet tool install Husky dotnet tool restore dotnet husky install -dotnet husky add pre-commit -echo {"scripts": {}}>package.json +REM dotnet husky add pre-commit +copy "G:\VS-Code-Settings\Git\pre-commit" "G:\%~1\.husky\pre-commit" +copy "G:\VS-Code-Settings\Git\task-runner.json" "G:\%~1\.husky\task-runner.json" +copy "G:\VS-Code-Settings\Git\package.json" "G:\%~1\package.json" git add . git commit -m "Initial Commit" git push origin master diff --git a/Git/package.json b/Git/package.json new file mode 100644 index 0000000..93c8c57 --- /dev/null +++ b/Git/package.json @@ -0,0 +1,9 @@ +{ + "scripts": { + "prepare": "dotnet tool restore && dotnet husky install", + "pre-commit": "dotnet husky run --group \"pre-commit\"", + "build": "dotnet build --runtime win-x64 --self-contained", + "pull": "git pull", + "garbage-collect": "git gc" + } +} \ No newline at end of file diff --git a/Git/pre-commit b/Git/pre-commit new file mode 100644 index 0000000..089fc27 --- /dev/null +++ b/Git/pre-commit @@ -0,0 +1,22 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +## husky task runner examples ------------------- +## Note : for local installation use 'dotnet' prefix. e.g. 'dotnet husky' + +## run all tasks +#husky run + +### run all tasks with group: 'group-name' +#husky run --group group-name + +## run task with name: 'task-name' +#husky run --name task-name + +## pass hook arguments to task +#husky run --args "$1" "$2" + +## or put your custom commands ------------------- +#echo 'Husky.Net is awesome!' + +dotnet husky run --group "pre-commit" diff --git a/Git/task-runner.json b/Git/task-runner.json new file mode 100644 index 0000000..5ba004a --- /dev/null +++ b/Git/task-runner.json @@ -0,0 +1,18 @@ +{ + "tasks": [ + { + "group": "pre-commit", + "name": "dotnet-format", + "command": "dotnet", + "args": [ + "format", + "--report", + ".vscode", + "--verbosity", + "detailed", + "--severity", + "error" + ] + } + ] +} \ No newline at end of file diff --git a/Visual Studio Settings/.editorconfig b/Visual Studio Settings/.editorconfig index 13f242a..a3ebdb2 100644 --- a/Visual Studio Settings/.editorconfig +++ b/Visual Studio Settings/.editorconfig @@ -114,9 +114,9 @@ csharp_style_deconstructed_variable_declaration = false csharp_style_implicit_object_creation_when_type_is_apparent = true:warning csharp_style_inlined_variable_declaration = false csharp_style_pattern_local_over_anonymous_function = true:warning -csharp_style_prefer_index_operator = true:warning +csharp_style_prefer_index_operator = false:warning csharp_style_prefer_null_check_over_type_check = true -csharp_style_prefer_range_operator = true:warning +csharp_style_prefer_range_operator = false:warning csharp_style_throw_expression = true csharp_style_unused_value_assignment_preference = discard_variable:warning csharp_style_unused_value_expression_statement_preference = discard_variable:warning