Fix script names

This commit is contained in:
crschnick 2023-10-05 11:53:27 +00:00
parent 680dd75abe
commit e7d595c70a
4 changed files with 37 additions and 41 deletions

View file

@ -19,7 +19,7 @@ public enum PredefinedScriptStore {
() -> SimpleScriptStore.builder()
.group(PredefinedScriptGroup.CLINK.getEntry())
.minimumDialect(ShellDialects.CMD)
.commands(file("starship_cmd.bat"))
.commands(file("clink.bat"))
.executionType(SimpleScriptStore.ExecutionType.TERMINAL_ONLY)
.build()),
CLINK_INJECT(
@ -46,18 +46,7 @@ public enum PredefinedScriptStore {
.group(PredefinedScriptGroup.STARSHIP.getEntry())
.minimumDialect(ShellDialects.CMD)
.script(SETUP_CLINK.getEntry())
.commands(
"""
WHERE starship >NUL 2>NUL
IF NOT %ERRORLEVEL%==0 (
winget install starship
SET "PATH=%PATH%;C:\\Program Files\\starship\\bin"
)
MKDIR "%USERPROFILE%\\.xpipe\\scriptdata\\starship" >NUL 2>NUL
echo load(io.popen('starship init cmd'):read("*a"))() > "%USERPROFILE%\\.xpipe\\scriptdata\\starship\\starship.lua"
clink inject --quiet --profile "%USERPROFILE%\\.xpipe\\scriptdata\\starship"
""")
.commands(file("starship_cmd.bat"))
.executionType(SimpleScriptStore.ExecutionType.TERMINAL_ONLY)
.build()),
STARSHIP_POWERSHELL(
@ -65,17 +54,7 @@ public enum PredefinedScriptStore {
() -> SimpleScriptStore.builder()
.group(PredefinedScriptGroup.STARSHIP.getEntry())
.minimumDialect(ShellDialects.POWERSHELL)
.commands(
"""
if (-not $(Get-Command -ErrorAction SilentlyContinue starship)) {
winget install starship
# Update current process PATH environment variable
$env:Path=([System.Environment]::GetEnvironmentVariable("Path", "Machine"), [System.Environment]::GetEnvironmentVariable("Path", "User")) -match '.' -join ';'
}
Invoke-Expression (&starship init powershell)
""")
.commands(file("starship_powershell.ps1"))
.executionType(SimpleScriptStore.ExecutionType.TERMINAL_ONLY)
.build());

View file

@ -0,0 +1,19 @@
WHERE clink >NUL 2>NUL
IF %ERRORLEVEL%==0 (
exit /b 0
)
SET "PATH=%PATH%;%USERPROFILE%\.xpipe\scriptdata\clink"
WHERE clink >NUL 2>NUL
IF %ERRORLEVEL%==0 (
exit /b 0
)
echo ^
$downloader = New-Object System.Net.WebClient;^
$defaultCreds = [System.Net.CredentialCache]::DefaultCredentials;^
if ($defaultCreds) {^
$downloader.Credentials = $defaultCreds^
}^
$downloader.DownloadFile("https://github.com/chrisant996/clink/releases/download/v1.5.7/clink.1.5.7.36d0c6.zip", "$env:TEMP\clink.zip");^
Expand-Archive -Force -LiteralPath "$env:TEMP\clink.zip" -DestinationPath "$env:USERPROFILE\.xpipe\scriptdata\clink"; | powershell -NoLogo >NUL

View file

@ -1,19 +1,9 @@
WHERE clink >NUL 2>NUL
IF %ERRORLEVEL%==0 (
exit /b 0
WHERE starship >NUL 2>NUL
IF NOT %ERRORLEVEL%==0 (
winget install starship
SET "PATH=%PATH%;C:\\Program Files\\starship\\bin"
)
SET "PATH=%PATH%;%USERPROFILE%\.xpipe\scriptdata\clink"
WHERE clink >NUL 2>NUL
IF %ERRORLEVEL%==0 (
exit /b 0
)
echo ^
$downloader = New-Object System.Net.WebClient;^
$defaultCreds = [System.Net.CredentialCache]::DefaultCredentials;^
if ($defaultCreds) {^
$downloader.Credentials = $defaultCreds^
}^
$downloader.DownloadFile("https://github.com/chrisant996/clink/releases/download/v1.5.7/clink.1.5.7.36d0c6.zip", "$env:TEMP\clink.zip");^
Expand-Archive -Force -LiteralPath "$env:TEMP\clink.zip" -DestinationPath "$env:USERPROFILE\.xpipe\scriptdata\clink"; | powershell -NoLogo >NUL
MKDIR "%USERPROFILE%\\.xpipe\\scriptdata\\starship" >NUL 2>NUL
echo load(io.popen('starship init cmd'):read("*a"))() > "%USERPROFILE%\\.xpipe\\scriptdata\\starship\\starship.lua"
clink inject --quiet --profile "%USERPROFILE%\\.xpipe\\scriptdata\\starship"

View file

@ -0,0 +1,8 @@
if (-not $(Get-Command -ErrorAction SilentlyContinue starship)) {
winget install starship
# Update current process PATH environment variable
$env:Path=([System.Environment]::GetEnvironmentVariable("Path", "Machine"), [System.Environment]::GetEnvironmentVariable("Path", "User")) -match '.' -join ';'
}
Invoke-Expression (&starship init powershell)