Skip to content

Commit

Permalink
scripts: fix bsd
Browse files Browse the repository at this point in the history
  • Loading branch information
EugeneOne1 committed May 17, 2021
1 parent 3308921 commit 6477701
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,26 @@ fix_darwin() {
out_dir='/Applications'
}

# Function fix_bsd performs some fixes to make it work on 'freebsd'-detected
# operating systems.
fix_bsd() {
if ! [ "$os" = 'freebsd' ]
then
return 0
fi

if ! [ -d "$out_dir" ]
then
mkdir "$out_dir"
fi

readonly rcd='/usr/local/etc/rc.d'
if ! [ -d "$rcd" ]
then
mkdir "$rcd"
fi
}

# Function configure sets the script's configuration.
configure() {
set_channel
Expand Down Expand Up @@ -477,6 +497,8 @@ if ! is_root
then
rerun_with_root
fi
# Needs rights.
fix_bsd

handle_existing

Expand Down

0 comments on commit 6477701

Please sign in to comment.