Create-Shortcut

This commit is contained in:
Mike Phares 2022-01-31 14:57:15 -07:00
parent ca79ea6114
commit 32462802f0
7 changed files with 85 additions and 30 deletions

View File

@ -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

6
Git/Create-Shortcut.vbs Normal file
View File

@ -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

View File

@ -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

9
Git/package.json Normal file
View File

@ -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"
}
}

22
Git/pre-commit Normal file
View File

@ -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"

18
Git/task-runner.json Normal file
View File

@ -0,0 +1,18 @@
{
"tasks": [
{
"group": "pre-commit",
"name": "dotnet-format",
"command": "dotnet",
"args": [
"format",
"--report",
".vscode",
"--verbosity",
"detailed",
"--severity",
"error"
]
}
]
}

View File

@ -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