Streamline aliae
installation
This commit is contained in:
parent
a761514d2a
commit
5e5bb3e5df
9 changed files with 114 additions and 2 deletions
scripts/Common/Software
28
scripts/Common/Software/aliae/aliae.yml
Normal file
28
scripts/Common/Software/aliae/aliae.yml
Normal file
|
@ -0,0 +1,28 @@
|
|||
alias:
|
||||
- name: totsch
|
||||
value: git
|
||||
env:
|
||||
- name: POSH_THEME
|
||||
value: '{{ if eq .OS "windows" }}{{ .Home }}/Nextcloud/.omp{{ else }}/usr/local/share/oh-my-posh/themes{{ end }}/manuel.omp.json'
|
||||
path: []
|
||||
script:
|
||||
- value: |
|
||||
while IFS= read -r -d '' file;
|
||||
do
|
||||
. "$file";
|
||||
done < <(find {/etc,~/.config}/bash/conf.d/* -print0 2> /dev/null);
|
||||
if: match .Shell "bash"
|
||||
- value: |
|
||||
# Profile Files
|
||||
$profileRoot = Split-Path -Parent $PROFILE;
|
||||
$profilePaths = @(
|
||||
"$profileRoot/conf.d/*.ps1",
|
||||
"{{ if eq .OS "windows" }}$env:ProgramData{{ else }}/etc{{ end }}/powershell/conf.d/*.ps1"
|
||||
);
|
||||
|
||||
foreach ($profilePath in $profilePaths) {
|
||||
if (Test-Path $profilePath) {
|
||||
Get-Item $profilePath | ForEach-Object { . $_; };
|
||||
}
|
||||
}
|
||||
if: match .Shell "pwsh"
|
35
scripts/Common/Software/aliae/main.fish
Normal file
35
scripts/Common/Software/aliae/main.fish
Normal file
|
@ -0,0 +1,35 @@
|
|||
#!/bin/env fish
|
||||
begin
|
||||
set -l dir (status dirname)
|
||||
source "$dir/../../Scripts/software.fish"
|
||||
|
||||
function installSW
|
||||
configureSW
|
||||
end
|
||||
|
||||
function configureSW -V dir
|
||||
source "$dir/../bash/profile.fish"
|
||||
source "$dir/../fish/profile.fish"
|
||||
set -l file /etc/aliae/aliae.yml
|
||||
sudo install -Dm644 "$dir/aliae.yml" "$file"
|
||||
|
||||
function getBashStatements
|
||||
echo 'eval "$(aliae init bash)"'
|
||||
echo 'eval "$(aliae completion bash)"'
|
||||
end
|
||||
|
||||
begin
|
||||
echo "export ALIAE_CONFIG=$(string escape "$file")"
|
||||
end | installBashProfile "aliae" "aliae"
|
||||
|
||||
if type -q fish
|
||||
begin
|
||||
printf %s\n \
|
||||
"aliae init fish | source" \
|
||||
"aliae completion fish | source"
|
||||
end | installFishProfile "aliae" "aliae"
|
||||
end
|
||||
end
|
||||
|
||||
runInstaller $argv
|
||||
end
|
30
scripts/Common/Software/bash/profile.fish
Normal file
30
scripts/Common/Software/bash/profile.fish
Normal file
|
@ -0,0 +1,30 @@
|
|||
#!/bin/env fish
|
||||
begin
|
||||
set -l dir (status dirname)
|
||||
source "$dir/../../Scripts/profile-base.fish"
|
||||
|
||||
function getBashStatements
|
||||
end
|
||||
|
||||
function processContent -a content
|
||||
set -l statements (getBashStatements)
|
||||
echo "$content"
|
||||
|
||||
if [ (echo "$statements" | wc -l) -gt 0 ]
|
||||
printf %s\n \
|
||||
"" \
|
||||
'if test "$BASH"' \
|
||||
"then"
|
||||
|
||||
echo "$statements" | while read -l line
|
||||
echo " $line"
|
||||
end
|
||||
|
||||
echo "fi"
|
||||
end
|
||||
end
|
||||
|
||||
function installBashProfile -a name title
|
||||
addProfileStatement "$name" "$title" /bin/bash sh /etc/bash/conf.d $argv[3..]
|
||||
end
|
||||
end
|
9
scripts/Common/Software/fish/profile.fish
Normal file
9
scripts/Common/Software/fish/profile.fish
Normal file
|
@ -0,0 +1,9 @@
|
|||
#!/bin/env fish
|
||||
begin
|
||||
set -l dir (status dirname)
|
||||
source "$dir/../../Scripts/profile-base.fish"
|
||||
|
||||
function installFishProfile -a name title
|
||||
addProfileStatement "$name" "$title" /bin/fish fish /etc/fish/conf.d $argv[3..]
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue