Allow global and personal profile files

This commit is contained in:
Manuel Thalmann 2024-03-20 19:43:40 +01:00
parent eaf9ed7f8a
commit 53ed5bb8c0

View file

@ -3,14 +3,19 @@ env: []
path: [] path: []
script: script:
- value: | - value: |
[ -f /bash/conf.d/* ] && . /bash/conf.d/* || true [ -f /bash/conf.d/* ~/.config/bash/conf.d/* ] && . /bash/conf.d/* ~/.config/bash/conf.d/* || true
if: match .Shell "bash" if: match .Shell "bash"
- value: | - value: |
# Profile Files # Profile Files
$profileRoot = Split-Path -Parent $PROFILE; $profileRoot = Split-Path -Parent $PROFILE;
$profilePath = "$profileRoot/profile.d/*.ps1"; $profilePaths = @(
"$profileRoot/profile.d/*.ps1",
"{{ if eq .OS "windows" }}C:/ProgramData{{ else }}/etc/powershell{{ end }}/profile.d"
);
foreach ($profilePath in $profilePaths) {
if (Test-Path $profilePath) { if (Test-Path $profilePath) {
Get-Item $profilePath | ForEach-Object { . $_; }; Get-Item $profilePath | ForEach-Object { . $_; };
} }
}
if: match .Shell "pwsh" if: match .Shell "pwsh"