PortValhalla/scripts/Common/Scripts/profile-base.fish

24 lines
528 B
Fish
Raw Normal View History

2024-07-16 01:30:14 +00:00
#!/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