File tree Expand file tree Collapse file tree 3 files changed +18
-16
lines changed Expand file tree Collapse file tree 3 files changed +18
-16
lines changed Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
- # parameters: $1=folder $2=username $3=branch $4=map $5=debug
2
+ # parameters: $1=folder $2=repository $3=branch $4=map $5=debug
3
3
set -e
4
4
repo_name=" RedMew"
5
5
6
6
folder=$1
7
- username =$2
7
+ repository =$2
8
8
branch=$3
9
9
map=$4
10
10
11
11
if [ -z " $folder " ]; then
12
12
echo " Missing argument: folder."
13
13
exit 1
14
14
fi
15
- if [ -z " $username " ]; then
16
- echo " Missing argument: github username ."
15
+ if [ -z " $repository " ]; then
16
+ echo " Missing argument: github repository ."
17
17
exit 1
18
18
fi
19
19
if [ -z " $branch " ]; then
33
33
34
34
echo " Updating folder: \" $folder \" ..."
35
35
36
- url=" https://github.com/$username /$repo_name .git"
36
+ url=" https://github.com/$repository /$repo_name .git"
37
37
38
38
git --git-dir=/factorio/scenarios/" $folder " /.git/ --work-tree=/factorio/scenarios/" $folder " / fetch " $url " " $branch " > /dev/null
39
39
git --git-dir=/factorio/scenarios/" $folder " /.git/ --work-tree=/factorio/scenarios/" $folder " / reset --hard " FETCH_HEAD" > /dev/null
62
62
63
63
touch /factorio/scenarios/" $folder "
64
64
65
- echo " $folder updated from $username $branch successfully with map: $map "
65
+ echo " $folder updated from $repository $branch successfully with map: $map "
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ if [ "$1" != "develop" ]; then
5
5
exit 0
6
6
fi
7
7
8
- # arguments to script: $1=folder $2=username $3=branch $4=map $5=debug
8
+ # arguments to script: $1=folder $2=repository $3=branch $4=map $5=debug
9
9
script_path=' /home/factorio/backend_scripts/git_update_scripts/generic-updater.sh'
10
10
log_path=' /home/factorio/backend_scripts/logs/github_webhook_output.txt'
11
11
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
- # parameters: $1=folder $2=username $3=branch $4=map $5=debug
3
- # #parameters: $1=username $2=branch $3=map $4=debug
2
+ # parameters: $1=repository $2=branch $3=map $4=debug
4
3
set -e # this forces an exit on any error
5
4
6
5
if [ -z " $2 " ]; then
10
9
branch=$2
11
10
fi
12
11
13
- # If branch is develop or a PR, force them to take the Refactorio username .
12
+ # If branch is develop or a PR, force them to take the Refactorio repository .
14
13
if [ " $branch " == " develop" ] || [[ $branch == pr/* ]]; then
15
- echo " Develop or PR branch selected, changing username to Refactorio"
16
- username=" Refactorio"
14
+ echo " Develop or PR branch selected, changing repository to Refactorio"
15
+ repository=" Refactorio"
16
+ else
17
+ repository=$1
17
18
fi
18
19
19
20
if [ -z " $3 " ]; then
20
21
map=" default"
21
22
echo " No map provided, using 'default'."
22
23
else
23
- map=$2
24
+ map=$3
24
25
fi
25
26
26
27
if [ -z " $4 " ]; then
30
31
debug=$4
31
32
fi
32
33
33
- # Custom section for discord names =/= github usernames
34
+ # Custom section for discord names =/= github repository
34
35
35
- # arguments to script: folder=$1 username =$2 branch=$3 map=$4 debug=$5
36
+ # arguments to script: folder=$1 repository =$2 branch=$3 map=$4 debug=$5
36
37
script_path=' /home/factorio/backend_scripts/git_update_scripts/generic-updater.sh'
37
38
38
39
echo ' ------------------------------------------'
40
+ echo $script_path RedMew $repository " $branch " " $map " " $debug "
39
41
date
40
- $script_path RedMew $username " $branch " " $map " " $debug "
42
+ $script_path RedMew $repository " $branch " " $map " " $debug "
You can’t perform that action at this time.
0 commit comments