mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-04-27 14:51:14 -03:00
Some changes fix actual problems, e.g. missing spaces in square bracket tests,
and backticks unintentionally causing code execution when intended as formatting.
Others, such as conservative quoting probably work fine in the old version in
most situations, but it's nice to have some additional safety.
Using `{ ..; }` instead of `(..)` is just a small performance enhancement.
Many of these issues were identified by shellcheck, which might be useful in CI
as well.
32 lines
742 B
Bash
Executable File
32 lines
742 B
Bash
Executable File
#!/bin/sh
|
|
|
|
# Die if anything has an error
|
|
set -e
|
|
|
|
# Make sure we're run as root
|
|
scriptname=$(basename "$0")
|
|
if [ "$(id -u)" -ne 0 ]; then
|
|
echo "${scriptname} must be run as root"
|
|
exit 1
|
|
fi
|
|
|
|
# Set the prefix for installation
|
|
PREFIX=/usr/local
|
|
|
|
# Jump to the Resources directory
|
|
cd "$(dirname "$0")"
|
|
|
|
# Add us to the shells list
|
|
./add-shell "${PREFIX}/bin/fish"
|
|
|
|
# Ditto the base directory to the right place
|
|
ditto ./base "${PREFIX}"
|
|
|
|
# Announce our success
|
|
echo "fish has been installed under ${PREFIX}/ and added to /etc/shells (if it was not already present)"
|
|
echo "To start fish, run:"
|
|
echo " ${PREFIX}/bin/fish"
|
|
echo "If you wish to change your default shell to fish, run:"
|
|
echo " chsh -s ${PREFIX}/bin/fish"
|
|
echo "Enjoy!"
|