Added windows vbs script
This commit is contained in:
parent
b00103155a
commit
be0a3426fd
16
init.ps1
16
init.ps1
|
@ -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
|
|
2
init.sh
2
init.sh
|
@ -10,7 +10,7 @@ git init
|
||||||
git remote add all https://github.com/Notoric/$REPO.git
|
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://github.com/Notoric/$REPO.git
|
||||||
git remote set-url --add --push all https://gitea.notoricloud.net/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 branch -M main
|
||||||
git commit -m "initial commit"
|
git commit -m "initial commit"
|
||||||
git push all main
|
git push all main
|
|
@ -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
|
Loading…
Reference in New Issue