Skip to content

Commit 8e7e1eb

Browse files
author
Richard Siomporas
committed
Added custom launch args
1 parent 671d95b commit 8e7e1eb

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

quick_install.sh

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,33 @@ docker container rm $container_name
3939

4040
docker build --tag retropie-container:0.0.1 .
4141
docker run -it -d --name=retropie retropie-container:0.0.1
42-
docker cp $container_name:/home/pi/retropie-cfg.tar.gz $artifacts_path/retropie-cfg.tar.gz && tar -xvf $artifacts_path/retropie-cfg.tar.gz -C $artifacts_path/configs
43-
docker cp $container_name:/home/pi/retropie-roms.tar.gz $artifacts_path/retropie-roms.tar.gz && tar -xvf $artifacts_path/retropie-roms.tar.gz -C $artifacts_path/roms
42+
docker cp $container_name:/home/pi/retropie-cfg.tar.gz $artifacts_path/retropie-cfg.tar.gz && tar --skip-old-files -xvf $artifacts_path/retropie-cfg.tar.gz -C $artifacts_path/configs
43+
docker cp $container_name:/home/pi/retropie-roms.tar.gz $artifacts_path/retropie-roms.tar.gz && tar --skip-old-files -xvf $artifacts_path/retropie-roms.tar.gz -C $artifacts_path/roms
4444
docker container stop $container_name
4545
docker container rm $container_name
4646

4747
echo "" > $artifacts_path/run-retropie.sh
4848
echo "#!/bin/bash" >> $artifacts_path/run-retropie.sh
49+
echo "" >> $artifacts_path/run-retropie.sh
50+
echo "help()" >> $artifacts_path/run-retropie.sh
51+
echo "{" >> $artifacts_path/run-retropie.sh
52+
echo " echo \"\"" >> $artifacts_path/run-retropie.sh
53+
echo " echo \"Usage: $0 -h -c *custom arguments for docker run command\"" >> $artifacts_path/run-retropie.sh
54+
echo " echo -e \"\\t-h Print this help\"" >> $artifacts_path/run-retropie.sh
55+
echo " echo -e \"\\t-c any custom arguments you wish to provide to the docker run command, such as additional volume mounts\"" >> $artifacts_path/run-retropie.sh
56+
echo " exit 1" >> $artifacts_path/run-retropie.sh
57+
echo "}" >> $artifacts_path/run-retropie.sh
58+
echo "" >> $artifacts_path/run-retropie.sh
59+
echo "while getopts \":hc:\" opt" >> $artifacts_path/run-retropie.sh
60+
echo "do" >> $artifacts_path/run-retropie.sh
61+
echo " case "\$opt" in" >> $artifacts_path/run-retropie.sh
62+
echo " h ) help; exit 0 ;;" >> $artifacts_path/run-retropie.sh
63+
echo " c ) custom_args=\"$OPTARG\" ;;" >> $artifacts_path/run-retropie.sh
64+
echo " :) echo \"missing argument for option -$OPTARG\"; exit 1 ;;" >> $artifacts_path/run-retropie.sh
65+
echo " \?) echo \"didnt' get that\"; exit 1 ;;" >> $artifacts_path/run-retropie.sh
66+
echo " esac" >> $artifacts_path/run-retropie.sh
67+
echo "done" >> $artifacts_path/run-retropie.sh
68+
echo "" >> $artifacts_path/run-retropie.sh
4969
echo "roms_folder=$artifacts_path/roms" >> $artifacts_path/run-retropie.sh
5070
echo "bios_folder=$artifacts_path/bios" >> $artifacts_path/run-retropie.sh
5171
echo "config_folder=$artifacts_path/configs" >> $artifacts_path/run-retropie.sh
@@ -64,6 +84,7 @@ echo " -v /dev/input:/dev/input \\" >> $artifacts_path/run-retropie.sh
6484
echo " -v \$roms_folder:/home/pi/RetroPie/roms \\" >> $artifacts_path/run-retropie.sh
6585
echo " -v \$bios_folder:/home/pi/RetroPie/BIOS \\" >> $artifacts_path/run-retropie.sh
6686
echo " -v \$config_folder:/opt/retropie/configs \\" >> $artifacts_path/run-retropie.sh
87+
echo " \$custom_args \\" >> $artifacts_path/run-retropie.sh
6788
echo " \$container_name \\" >> $artifacts_path/run-retropie.sh
6889
echo " run" >> $artifacts_path/run-retropie.sh
6990
echo " " >> $artifacts_path/run-retropie.sh

0 commit comments

Comments
 (0)