[Linux Guide] Adding FTL to your path

Discuss problems related to FTL here. If you are having a problem or experiencing a bug PLEASE READ THE "MUST READ" POST.
jjcf89
Posts: 3
Joined: Sat Sep 15, 2012 3:54 am

[Linux Guide] Adding FTL to your path

Postby jjcf89 » Sat Sep 15, 2012 11:59 pm

In order to run the FTL script without having to cd into the FTL folder it can be modified by adding the following lines:

Code: Select all

# change to directory of script
here="$(dirname "$(readlink -f "$(which "$0")")")"
cd "$here"


Heres the full script with modification:

Code: Select all

#!/bin/bash

# change to directory of script
here="$(dirname "$(readlink -f "$(which "$0")")")"
cd "$here"

# enter the game directory
cd ./data


# run FTL
./FTL "$@"


Then in order to add the FTL script to your path you can symlink the script to your local ~/bin directory.

Code: Select all

cd ~/bin/
ln -s [path to FTL script] FTL


Now to test it just change to your home directory and type FTL

Code: Select all

cd ~
FTL


If it launches then your all set otherwise you'll need to check to make sure your ~/bin directory is in your path.

Code: Select all

echo $PATH


I won't go into how to set your PATH, just google it.