Skip to content

Commit 083cb73

Browse files
author
James Brundage
committed
feat: Start-Htmx ( Fixes #7 )
Updating container check and allowing url palettes
1 parent bfa45fb commit 083cb73

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Commands/Start-Htmx.ps1

+8-2
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,8 @@ function Start-Htmx {
353353
# If we are on unix, and a port has not been set,
354354
# and an environment variable indicates we are in a container, we will use port 80.
355355
if ($PSVersionTable.Platform -eq 'Unix' -and (
356-
Get-ChildItem env: | Where-Object Name -Match InContainer
356+
Get-ChildItem env: |
357+
Where-Object Name -Match 'In\P{p}{0,}Container'
357358
)) {
358359
if (-not $port) { $port = 80 }
359360
"http://*:$port/"
@@ -428,7 +429,12 @@ function Start-Htmx {
428429

429430
# If a palette name was provided, we will include the 4bitcss stylesheet.
430431
if ($PaletteName) {
431-
'<link type="text/css" rel="stylesheet" href="https://cdn.jsdelivr.net/gh/2bitdesigns/4bitcss@latest/css/.css" id="4bitcss" />' -replace '\.css', "$PaletteName.css"
432+
if ($PaletteName -match '/.+?\.css$') {
433+
"<link type='text/css' rel='stylesheet' href='$PaletteName' id='4bitcss' />"
434+
435+
} else {
436+
'<link type="text/css" rel="stylesheet" href="https://cdn.jsdelivr.net/gh/2bitdesigns/4bitcss@latest/css/.css" id="4bitcss" />' -replace '\.css', "$PaletteName.css"
437+
}
432438
}
433439
# If a code font was provided, we will include the code font stylesheet.
434440
if ($CodeFont) {

0 commit comments

Comments
 (0)