Compare commits
2 Commits
e7ce41cbbc
...
6d2e099eb4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6d2e099eb4 | ||
|
|
f696044461 |
47
README.md
47
README.md
@@ -77,30 +77,45 @@ Then run scripts using:
|
||||
|
||||
## Requirements
|
||||
|
||||
### Installation
|
||||
### Prerequisites
|
||||
|
||||
**Quick Automated Installation (Windows 11):**
|
||||
Install these tools before starting:
|
||||
|
||||
**PowerShell 7+**
|
||||
```powershell
|
||||
winget install Microsoft.PowerShell
|
||||
```
|
||||
|
||||
**Git 2.23+**
|
||||
```powershell
|
||||
winget install Git.Git
|
||||
```
|
||||
|
||||
**Visual Studio Code**
|
||||
```powershell
|
||||
winget install Microsoft.VisualStudioCode
|
||||
```
|
||||
|
||||
### Quick Start
|
||||
|
||||
**Option 1: Oneshot Installation (Recommended)**
|
||||
Download, install prerequisites, and clone the repository in one command:
|
||||
Install everything and clone the repository in one command:
|
||||
|
||||
```powershell
|
||||
irm https://git.frod.dk/floppydiscen/git-workshop/raw/branch/main/install.ps1 | iex
|
||||
```
|
||||
|
||||
This will:
|
||||
- Install PowerShell 7, Git 2.23+, and Visual Studio Code
|
||||
- Clone the git-workshop repository to `~/git-workshop`
|
||||
- Leave you ready to start the first module
|
||||
|
||||
**Option 2: Local Installation**
|
||||
Clone the repository first, then run:
|
||||
|
||||
```powershell
|
||||
.\install-prerequisites.ps1
|
||||
```
|
||||
|
||||
**Manual Installation:** See [INSTALLATION.md](INSTALLATION.md) for complete step-by-step installation instructions including PowerShell 7, Git, and Visual Studio Code.
|
||||
**Option 2: Manual Setup**
|
||||
1. Install the prerequisites above
|
||||
2. Clone this repository:
|
||||
```powershell
|
||||
git clone https://git.frod.dk/floppydiscen/git-workshop.git
|
||||
```
|
||||
3. Configure Git:
|
||||
```powershell
|
||||
git config --global user.name "Your Name"
|
||||
git config --global user.email "your.email@example.com"
|
||||
```
|
||||
|
||||
**Quick Check:**
|
||||
|
||||
|
||||
@@ -146,7 +146,12 @@ function Install-Package {
|
||||
Write-Host " Running: $installCmd" -ForegroundColor Gray
|
||||
|
||||
try {
|
||||
# Show progress during installation
|
||||
Write-Progress -Activity "Installing $Name" -Status "Downloading and installing..." -PercentComplete 25
|
||||
|
||||
$result = Invoke-Expression $installCmd 2>&1
|
||||
|
||||
Write-Progress -Activity "Installing $Name" -Status "Verifying installation..." -PercentComplete 75
|
||||
|
||||
# Check if installation succeeded
|
||||
Start-Sleep -Seconds 2 # Give the system time to register the new command
|
||||
@@ -157,16 +162,19 @@ function Install-Package {
|
||||
if (Test-CommandExists $CheckCommand) {
|
||||
$version = Get-InstalledVersion $CheckCommand
|
||||
Write-Success "$Name installed successfully: $version"
|
||||
Write-Progress -Activity "Installing $Name" -Completed
|
||||
return $true
|
||||
}
|
||||
else {
|
||||
Write-Warning "$Name installation completed, but command '$CheckCommand' not found."
|
||||
Write-Host " You may need to restart your terminal or computer." -ForegroundColor Yellow
|
||||
Write-Progress -Activity "Installing $Name" -Completed
|
||||
return $false
|
||||
}
|
||||
}
|
||||
catch {
|
||||
Write-Error "Failed to install $Name`: $_"
|
||||
Write-Progress -Activity "Installing $Name" -Completed
|
||||
return $false
|
||||
}
|
||||
}
|
||||
@@ -253,19 +261,38 @@ $results = @{
|
||||
WindowsTerminal = $null
|
||||
}
|
||||
|
||||
# Progress tracking
|
||||
$totalSteps = 3 # Required installations
|
||||
$currentStep = 0
|
||||
|
||||
Write-Host "`nStarting installation..." -ForegroundColor Cyan
|
||||
Write-Host "Note: Some installations may take a few minutes." -ForegroundColor Gray
|
||||
Write-Host ""
|
||||
|
||||
# Progress bar helper
|
||||
function Write-ProgressIndicator {
|
||||
param(
|
||||
[string]$Activity,
|
||||
[string]$Status,
|
||||
[int]$PercentComplete
|
||||
)
|
||||
|
||||
Write-Progress -Activity $Activity -Status $Status -PercentComplete $PercentComplete
|
||||
}
|
||||
|
||||
#region Required Installations
|
||||
|
||||
# Install PowerShell 7
|
||||
$currentStep++
|
||||
Write-ProgressIndicator -Activity "Installing Required Tools" -Status "Installing PowerShell 7 (1/3)" -PercentComplete (($currentStep / $totalSteps) * 100)
|
||||
$results.PowerShell = Install-Package `
|
||||
-Name "PowerShell 7" `
|
||||
-WingetId "Microsoft.PowerShell" `
|
||||
-CheckCommand "pwsh"
|
||||
|
||||
# Install Git
|
||||
$currentStep++
|
||||
Write-ProgressIndicator -Activity "Installing Required Tools" -Status "Installing Git (2/3)" -PercentComplete (($currentStep / $totalSteps) * 100)
|
||||
$results.Git = Install-Package `
|
||||
-Name "Git" `
|
||||
-WingetId "Git.Git" `
|
||||
@@ -282,11 +309,16 @@ if ($results.Git) {
|
||||
}
|
||||
|
||||
# Install Visual Studio Code
|
||||
$currentStep++
|
||||
Write-ProgressIndicator -Activity "Installing Required Tools" -Status "Installing Visual Studio Code (3/3)" -PercentComplete (($currentStep / $totalSteps) * 100)
|
||||
$results.VSCode = Install-Package `
|
||||
-Name "Visual Studio Code" `
|
||||
-WingetId "Microsoft.VisualStudioCode" `
|
||||
-CheckCommand "code"
|
||||
|
||||
# Clear progress bar
|
||||
Write-Progress -Activity "Installing Required Tools" -Completed
|
||||
|
||||
#endregion
|
||||
|
||||
#region Optional Installations
|
||||
@@ -294,10 +326,12 @@ $results.VSCode = Install-Package `
|
||||
# Python 3.12 (optional)
|
||||
Write-Host ""
|
||||
if (Get-UserConfirmation "Do you want to install Python 3.12? (Required for Module 08: Multiplayer Git)") {
|
||||
Write-ProgressIndicator -Activity "Installing Optional Tools" -Status "Installing Python 3.12" -PercentComplete 50
|
||||
$results.Python = Install-Package `
|
||||
-Name "Python 3.12" `
|
||||
-WingetId "Python.Python.3.12" `
|
||||
-CheckCommand "python"
|
||||
Write-Progress -Activity "Installing Optional Tools" -Completed
|
||||
}
|
||||
else {
|
||||
Write-Host " Skipping Python installation." -ForegroundColor Gray
|
||||
@@ -307,10 +341,12 @@ else {
|
||||
# Windows Terminal (optional)
|
||||
Write-Host ""
|
||||
if (Get-UserConfirmation "Do you want to install Windows Terminal? (Highly recommended for better terminal experience)") {
|
||||
Write-ProgressIndicator -Activity "Installing Optional Tools" -Status "Installing Windows Terminal" -PercentComplete 50
|
||||
$results.WindowsTerminal = Install-Package `
|
||||
-Name "Windows Terminal" `
|
||||
-WingetId "Microsoft.WindowsTerminal" `
|
||||
-CheckCommand "wt"
|
||||
Write-Progress -Activity "Installing Optional Tools" -Completed
|
||||
}
|
||||
else {
|
||||
Write-Host " Skipping Windows Terminal installation." -ForegroundColor Gray
|
||||
|
||||
Reference in New Issue
Block a user