Skip to content
Snippets Groups Projects
Commit 7118b2a9 authored by Mathieu Loiseau's avatar Mathieu Loiseau
Browse files

no more need to indicate script location in alias or anywhere

parent 2287f6c8
No related branches found
No related tags found
No related merge requests found
#!/bin/bash #!/bin/bash
#configure working directories export killProcessesScript="killControllers.sh"
export workingDirectory="/where/gamepad-switcher/is" \ No newline at end of file
export killProcessesScript="a/shell/file/that/will/be/created/and/erased/in/working/directory"
\ No newline at end of file
...@@ -4,8 +4,10 @@ ...@@ -4,8 +4,10 @@
# 2 → name of the game as suggested in menu # 2 → name of the game as suggested in menu
#configuration #configuration
. ./config.sh export workingDirectory="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/"
#(thanks http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in)
cd $workingDirectory cd $workingDirectory
. ./config.sh
if [ -e "$killProcessesScript" ] if [ -e "$killProcessesScript" ]
then then
echo "There seems to be (a) running instance(s) of the game controller, do you want to brutally kill the processes? (Y/n)\nI'm not sure what it does if you don't…" echo "There seems to be (a) running instance(s) of the game controller, do you want to brutally kill the processes? (Y/n)\nI'm not sure what it does if you don't…"
......
...@@ -2,4 +2,4 @@ This is a gamepad module switching script intended for use with the Microsoft Xb ...@@ -2,4 +2,4 @@ This is a gamepad module switching script intended for use with the Microsoft Xb
To permanently add an alias add the following line to ~/.bash_aliases (if the file does not exist, simply create one) and substitute the name and path as necessary: To permanently add an alias add the following line to ~/.bash_aliases (if the file does not exist, simply create one) and substitute the name and path as necessary:
alias <name_of_alias>="cd /path/to/this/folder && ./game.sh && cd -" alias <name_of_alias>="/path/to/this/folder/game.sh"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment