Streamline aliae installation

This commit is contained in:
Manuel Thalmann 2024-07-16 03:30:14 +02:00
parent a761514d2a
commit 5e5bb3e5df
9 changed files with 114 additions and 2 deletions

View file

@ -53,6 +53,8 @@ begin
nvtop \ nvtop \
numbat-bin \ numbat-bin \
terminal-parrot terminal-parrot
source "$dir/../Software/aliae/main.fish"
end end
end end
end end

View file

@ -0,0 +1,13 @@
#!/bin/env fish
begin
set -l dir (status dirname)
source "$dir/../../Scripts/software.fish"
source "$dir/../../../Common/Software/aliae/main.fish"
function installSW
yayinst \
aliae-bin
end
runInstaller $argv
end

View file

@ -0,0 +1,23 @@
#!/bin/env fish
begin
function processContent -a content
echo "$content"
end
function addProfileStatement -a name title shellBin extension profileRoot content
set -l file (mktemp)
if [ -z "$content" ]
read -l content
end
begin
printf %s\n \
"#!$shellBin" \
"# $title" \
(processContent "$content")
end > "$file"
sudo install -Dm755 "$file" "$profileRoot/$name.$extension"
end
end

View 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

View 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

View 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

View file

@ -4,7 +4,7 @@ configPath="/etc/aliae/aliae.yml";
. "../../../Common/Config/aliae/install.sh"; . "../../../Common/Config/aliae/install.sh";
. "../../../Common/Config/fish/profile.sh"; . "../../../Common/Config/fish/profile.sh";
sudo install -Dm644 "../../../Common/Config/aliae/aliae.yml" "$configPath"; sudo install -Dm644 "../../../Common/Software/aliae/aliae.yml" "$configPath";
function dump_header() { function dump_header() {
echo "# aliae"; echo "# aliae";

View file

@ -4,5 +4,5 @@ $configFile="$env:ProgramData/aliae/aliae.yml";
Start-BashScript "bash `"$PSScriptRoot/../../../Common/Config/aliae/install.sh`""; Start-BashScript "bash `"$PSScriptRoot/../../../Common/Config/aliae/install.sh`"";
$null = New-Item -Force $configFile; $null = New-Item -Force $configFile;
Copy-Item -Force "$PSScriptRoot/../../../Common/Config/aliae/aliae.yml" $configFile; Copy-Item -Force "$PSScriptRoot/../../../Common/Software/aliae/aliae.yml" $configFile;
[Environment]::SetEnvironmentVariable("ALIAE_CONFIG", $configFile, [System.EnvironmentVariableTarget]::Machine) [Environment]::SetEnvironmentVariable("ALIAE_CONFIG", $configFile, [System.EnvironmentVariableTarget]::Machine)