Streamline aliae
installation
This commit is contained in:
parent
a761514d2a
commit
5e5bb3e5df
9 changed files with 114 additions and 2 deletions
|
@ -53,6 +53,8 @@ begin
|
|||
nvtop \
|
||||
numbat-bin \
|
||||
terminal-parrot
|
||||
|
||||
source "$dir/../Software/aliae/main.fish"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
13
scripts/Arch/Software/aliae/main.fish
Normal file
13
scripts/Arch/Software/aliae/main.fish
Normal 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
|
23
scripts/Common/Scripts/profile-base.fish
Normal file
23
scripts/Common/Scripts/profile-base.fish
Normal 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
|
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
|
|
@ -4,7 +4,7 @@ configPath="/etc/aliae/aliae.yml";
|
|||
|
||||
. "../../../Common/Config/aliae/install.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() {
|
||||
echo "# aliae";
|
||||
|
|
|
@ -4,5 +4,5 @@ $configFile="$env:ProgramData/aliae/aliae.yml";
|
|||
Start-BashScript "bash `"$PSScriptRoot/../../../Common/Config/aliae/install.sh`"";
|
||||
|
||||
$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)
|
||||
|
|
Loading…
Reference in a new issue