Skip to content

Commit 9adbee6

Browse files
author
Scott Arbeit
committed
Repaired tabs in makefile 🙄; added variable set in script.
1 parent 2b258ba commit 9adbee6

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed

Makefile.win

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,15 @@ endif
1919
# Find all Go source files
2020
GO_SRC_FILES := $(shell powershell -NoProfile -ExecutionPolicy Bypass -Command "Get-ChildItem -Path . -Filter *.go -Recurse | Select-Object -ExpandProperty FullName")
2121

22+
# Define common PowerShell command
23+
PWSH := @powershell -NoProfile -ExecutionPolicy Bypass -Command
24+
2225
# Default target
2326
all: bin/git-sizer.exe
2427

2528
# Main binary target - depend on all Go source files
2629
bin/git-sizer.exe: $(GO_SRC_FILES)
27-
@powershell -NoProfile -ExecutionPolicy Bypass -Command "if (-not (Test-Path bin)) { New-Item -ItemType Directory -Path bin | Out-Null }"
30+
$(PWSH) "if (-not (Test-Path bin)) { New-Item -ItemType Directory -Path bin | Out-Null }"
2831
$(GO) build $(GOFLAGS) -ldflags "$(LDFLAGS)" -a -o .\bin\git-sizer.exe .
2932

3033
# Test target - explicitly run the build first to ensure binary is up to date
@@ -38,17 +41,17 @@ gotest:
3841

3942
# Clean up builds
4043
clean:
41-
@powershell -NoProfile -ExecutionPolicy Bypass -Command "if (Test-Path bin) { Remove-Item -Recurse -Force bin }"
44+
$(PWSH) "if (Test-Path bin) { Remove-Item -Recurse -Force bin }"
4245

4346
# Help target
4447
help:
45-
@powershell -NoProfile -ExecutionPolicy Bypass -Command "Write-Host 'Windows Makefile for git-sizer' -ForegroundColor Cyan"
46-
@powershell -NoProfile -ExecutionPolicy Bypass -Command "Write-Host ''"
47-
@powershell -NoProfile -ExecutionPolicy Bypass -Command "Write-Host 'Targets:' -ForegroundColor Green"
48-
@powershell -NoProfile -ExecutionPolicy Bypass -Command "Write-Host ' all - Build git-sizer (default)'"
49-
@powershell -NoProfile -ExecutionPolicy Bypass -Command "Write-Host ' test - Run tests'"
50-
@powershell -NoProfile -ExecutionPolicy Bypass -Command "Write-Host ' clean - Clean build artifacts'"
51-
@powershell -NoProfile -ExecutionPolicy Bypass -Command "Write-Host ''"
52-
@powershell -NoProfile -ExecutionPolicy Bypass -Command "Write-Host 'Example usage:' -ForegroundColor Green"
53-
@powershell -NoProfile -ExecutionPolicy Bypass -Command "Write-Host ' nmake -f Makefile.win'"
54-
@powershell -NoProfile -ExecutionPolicy Bypass -Command "Write-Host ' nmake -f Makefile.win test'"
48+
$(PWSH) "Write-Host 'Windows Makefile for git-sizer' -ForegroundColor Cyan"
49+
$(PWSH) "Write-Host ''"
50+
$(PWSH) "Write-Host 'Targets:' -ForegroundColor Green"
51+
$(PWSH) "Write-Host ' all - Build git-sizer (default)'"
52+
$(PWSH) "Write-Host ' test - Run tests'"
53+
$(PWSH) "Write-Host ' clean - Clean build artifacts'"
54+
$(PWSH) "Write-Host ''"
55+
$(PWSH) "Write-Host 'Example usage:' -ForegroundColor Green"
56+
$(PWSH) "Write-Host ' make -f Makefile.win'"
57+
$(PWSH) "Write-Host ' make -f Makefile.win test'"

script/ensure-go-installed.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This script is meant to be sourced with ROOTDIR set.
22

33
if (-not $env:ROOTDIR) {
4-
Write-Error 'ensure-go-installed.ps1 invoked without ROOTDIR set!'
4+
$env:ROOTDIR = (Resolve-Path (Join-Path $scriptDir "..")).Path
55
}
66

77
# Function to check if Go is installed and at least version 1.21

0 commit comments

Comments
 (0)