diff --git a/init.ps1 b/init.ps1 deleted file mode 100644 index fc2c825..0000000 --- a/init.ps1 +++ /dev/null @@ -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 diff --git a/init.sh b/init.sh index ce73eef..fb70b25 100644 --- a/init.sh +++ b/init.sh @@ -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 \ No newline at end of file diff --git a/init.vbs b/init.vbs new file mode 100644 index 0000000..a403c1e --- /dev/null +++ b/init.vbs @@ -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 \ No newline at end of file