-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.ps1
28 lines (22 loc) · 972 Bytes
/
build.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
if (($args[0] -eq "curved") -or ($args[0] -eq "powerline") -or ($args[0] -eq "sharp")) {
if (!(Test-Item -Path .\build)) {
New-Item -Path . -Name "build" -ItemType Directory
}
Copy-Item -Path .\starship\std.toml -Destination .\build
$Content = (Get-Content -Path .\build\std.toml -Raw)
if ($args[0] -eq "curved") {
$Content = $Content -replace "{!CHAR_DIVIDER!}",""
}
elseif ($args[0] -eq "powerline") {
$Content = $Content -replace "{!CHAR_DIVIDER!}",""
}
else if ($args[0] -eq "sharp") {
$Content = $Content -replace "{!CHAR_DIVIDER!}",""
}
Set-Content -Path .\build\std.toml -Value "$Content"
if (!(Test-Item -Path "$Env:USERPROFILE\starship")) {
New-Item -Path $Env:USERPROFILE -Name "starship" -ItemType Directory
}
Copy-Item -Path .\build\std.toml -Destination "$Env:USERPROFILE\starship"
echo "Done. Don't forget to set your STARSHIP_CONFIG variable to point to $Env:USERPROFILE\starship\std.toml."
}