24 lines
528 B
Fish
24 lines
528 B
Fish
|
#!/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
|