Skip to content

Commit 84239fe

Browse files
committed
Change to repository rather than username
1 parent 1f3ba97 commit 84239fe

File tree

3 files changed

+18
-16
lines changed

3 files changed

+18
-16
lines changed

git_update_scripts/generic-updater.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
#!/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
33
set -e
44
repo_name="RedMew"
55

66
folder=$1
7-
username=$2
7+
repository=$2
88
branch=$3
99
map=$4
1010

1111
if [ -z "$folder" ]; then
1212
echo "Missing argument: folder."
1313
exit 1
1414
fi
15-
if [ -z "$username" ]; then
16-
echo "Missing argument: github username."
15+
if [ -z "$repository" ]; then
16+
echo "Missing argument: github repository."
1717
exit 1
1818
fi
1919
if [ -z "$branch" ]; then
@@ -33,7 +33,7 @@ fi
3333

3434
echo "Updating folder: \"$folder\"..."
3535

36-
url="https://github.com/$username/$repo_name.git"
36+
url="https://github.com/$repository/$repo_name.git"
3737

3838
git --git-dir=/factorio/scenarios/"$folder"/.git/ --work-tree=/factorio/scenarios/"$folder"/ fetch "$url" "$branch" > /dev/null
3939
git --git-dir=/factorio/scenarios/"$folder"/.git/ --work-tree=/factorio/scenarios/"$folder"/ reset --hard "FETCH_HEAD" > /dev/null
@@ -62,4 +62,4 @@ fi
6262

6363
touch /factorio/scenarios/"$folder"
6464

65-
echo "$folder updated from $username $branch successfully with map: $map"
65+
echo "$folder updated from $repository $branch successfully with map: $map"

git_update_scripts/github-webhook.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ if [ "$1" != "develop" ]; then
55
exit 0
66
fi
77

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
99
script_path='/home/factorio/backend_scripts/git_update_scripts/generic-updater.sh'
1010
log_path='/home/factorio/backend_scripts/logs/github_webhook_output.txt'
1111

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/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
43
set -e #this forces an exit on any error
54

65
if [ -z "$2" ]; then
@@ -10,17 +9,19 @@ else
109
branch=$2
1110
fi
1211

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.
1413
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
1718
fi
1819

1920
if [ -z "$3" ]; then
2021
map="default"
2122
echo "No map provided, using 'default'."
2223
else
23-
map=$2
24+
map=$3
2425
fi
2526

2627
if [ -z "$4" ]; then
@@ -30,11 +31,12 @@ else
3031
debug=$4
3132
fi
3233

33-
# Custom section for discord names =/= github usernames
34+
# Custom section for discord names =/= github repository
3435

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
3637
script_path='/home/factorio/backend_scripts/git_update_scripts/generic-updater.sh'
3738

3839
echo '------------------------------------------'
40+
echo $script_path RedMew $repository "$branch" "$map" "$debug"
3941
date
40-
$script_path RedMew $username "$branch" "$map" "$debug"
42+
$script_path RedMew $repository "$branch" "$map" "$debug"

0 commit comments

Comments
 (0)