Added windows vbs script

This commit is contained in:
Notoric 2024-06-09 20:39:04 +01:00
parent b00103155a
commit be0a3426fd
3 changed files with 24 additions and 17 deletions

View File

@ -1,16 +0,0 @@
# Get the current directory name
$current_dir = Split-Path -Path (Get-Location) -Leaf
# Create README.md file
New-Item -Path "$current_dir\README.md" -ItemType File
# Initialize git repository
git init
git remote add all "https://github.com/Notoric/$current_dir.git"
git remote set-url --add --push all "https://github.com/Notoric/$current_dir.git"
git remote set-url --add --push all "https://gitea.notoricloud.net/Notoric/$current_dir.git"
git add .
git branch -M main
git commit -m "initial commit"
git push origin main
git push gitea main

View File

@ -10,7 +10,7 @@ git init
git remote add all https://github.com/Notoric/$REPO.git
git remote set-url --add --push all https://github.com/Notoric/$REPO.git
git remote set-url --add --push all https://gitea.notoricloud.net/Notoric/$REPO.git
git add .
git add README.md
git branch -M main
git commit -m "initial commit"
git push all main

23
init.vbs Normal file
View File

@ -0,0 +1,23 @@
' Gets the current directory name
Set WSHShell = CreateObject("WScript.Shell")
currentDir = WSHShell.CurrentDirectory
currentDirName = Split(currentDir, "\")(UBound(Split(currentDir, "\")))
' Create README.md file
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.CreateTextFile(currentDir & "\README.md", True)
objFile.Close
' Initialize git repository
WSHShell.Run "cmd /c git init", vbMinimizedNoFocus
WSHShell.Run "cmd /c git remote add all ""https://github.com/Notoric/" & currentDirName & ".git""", vbMinimizedNoFocus
WSHShell.Run "cmd /c git remote set-url --add --push all ""https://github.com/Notoric/" & currentDirName & ".git""", vbMinimizedNoFocus
WSHShell.Run "cmd /c git remote set-url --add --push all ""https://gitea.notoricloud.net/Notoric/" & currentDirName & ".git""", vbMinimizedNoFocus
WSHShell.Run "cmd /c git add README.md", vbMinimizedNoFocus
WSHShell.Run "cmd /c git branch -M main", vbMinimizedNoFocus
WSHShell.Run "cmd /c git commit -m ""initial commit""", vbMinimizedNoFocus
WSHShell.Run "cmd /c git push all main", vbMinimizedNoFocus
' Clean up
Set WSHShell = Nothing
Set objFSO = Nothing