26 lines
921 B
Bash
Executable File
26 lines
921 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Exit immediately if a command exits with a non-zero status
|
|
set -e
|
|
|
|
echo "Building Toak Native AOT executable..."
|
|
dotnet publish -c Release -r linux-x64
|
|
|
|
echo "Installing to /usr/bin/toak... (This may prompt for your sudo password)"
|
|
sudo cp bin/Release/net10.0/linux-x64/publish/Toak /usr/bin/toak
|
|
|
|
if [ -d "/usr/share/zsh/site-functions" ]; then
|
|
echo "Installing zsh completions..."
|
|
sudo cp _toak /usr/share/zsh/site-functions/_toak
|
|
fi
|
|
|
|
echo "Installing and starting systemd user service..."
|
|
sudo mkdir -p ~/.config/systemd/user
|
|
sudo cp toak.service ~/.config/systemd/user/
|
|
sudo systemctl --user daemon-reload
|
|
sudo systemctl --user enable --now toak.service
|
|
|
|
echo "Installation complete! You can now run 'toak' from anywhere."
|
|
echo "Note: You may need to restart your zsh shell or run 'autoload -Uz compinit && compinit' to enable completions."
|
|
echo "The Toak daemon is running in the background."
|