Skip to content

Failure on install: "sed: -e: No such file or directory"

On the first install of sed in the install.sh I error out with sed: -e: No such file or directory

I put some aditional echo's in before it to issolate which one failed. It does appear the cp command also failed to copy the yaml and env files over. I ran that manually but it is still failing

I'm running this on macOS which from what I can tell should work

Here is my output with additional echos included

Checking prerequisites...
docker exists ✅ 
docker compose exists ✅ 
Where do you want to install the docker-compose file? [/opt/yams]: ~/Code/YAMS/
What's the user that is going to own the media server files? [kmfsousa]: 
Please, input your media directory [/srv/media]: ~/Code/srv/media
Are you sure your media directory is "~/Code/srv/media"? (y/N) [Default = n]: y



Time to choose your media service.
Your media service is responsible for serving your files to your network.
By default, YAMS supports 3 media services:
- jellyfin (recommended, easier)
- emby
- plex (advanced, always online)
Choose your media service [jellyfin]: 

YAMS is going to install "jellyfin" on port "8096"

Time to set up the VPN.
You can check the supported VPN list here: https://yams.media/advanced/vpn.
Do you want to configure a VPN? (Y/n) [Default = y]: n
Configuring the docker-compose file for the user "kmfsousa" on "~/Code/YAMS/"...

Copying docker-compose.example.yaml to ~/Code/YAMS//docker-compose.yaml...
docker-compose.example.yaml was copied successfuly! ✅

Copying .env.example to ~/Code/YAMS//.env...
.env.example was copied successfuly! ✅

Copying docker-compose.custom.yaml to ~/Code/YAMS//docker-compose.custom.yaml...
docker-compose.custom.yaml was copied successfuly! ✅
first sed
~/Code/YAMS//.env
502
20
~/Code/srv/media
jellyfin
~/Code/YAMS//docker-compose.yaml
sed: -e: No such file or directory

Install.sh modifications (added echos):

for file_mapping in "${copy_files[@]}"; do
    source_file="${file_mapping%%:*}"
    destination_file="${file_mapping##*:}"

    echo -e "\nCopying $source_file to $destination_file..."
    if cp "$source_file" "$destination_file"; then
        send_success_message "$source_file was copied successfuly! ✅"
    else
        send_error_message "Failed to copy $source_file to $destination_file. Ensure your user ($USER) has the necessary permissions ❌"
    fi
done

echo "first sed"

echo "$env_file"
echo "$puid"
echo "$pgid"
echo "$media_directory"
echo "$media_service"
echo "$filename"

sed -i -e "s|<your_PUID>|$puid|g" "$env_file" \
 -e "s|<your_PGID>|$pgid|g" "$env_file" \
 -e "s|<media_directory>|$media_directory|g" "$env_file" \
 -e "s|<media_service>|$media_service|g" "$env_file" \
 -e "s|<media_service>|$media_service|g" "$filename"