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