gsd-cli 0.1.37 → 0.1.39
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cli/install.rb +2 -13
- data/lib/cli/update.rb +14 -17
- data/lib/cli.rb +1 -1
- data/lib/game_template.rb +0 -8
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f63083cd5b8d265941eb98bc7d015101ed1168f9a04953cd32fedbf883abd88
|
4
|
+
data.tar.gz: 47705f05da2f10c015f279a3f28ecbd72a13090c194096b5687171c0e83ee9d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c4330bcc1dba2c9fb4c5c21e21fcc49aeef4c4c096c3e72f8e0fadc93a4358d19a7c56bfbdb3fdda795896568b6e02380a9e50ebbd073020ba9f8500f703edd
|
7
|
+
data.tar.gz: 21c970cec7c74cdae5f58032dec24df921b57a01c5a8641d7bacc7099d548254402e2856562820aaad7e93ab658c6eacbe0e63f25f6d23fef4f856097580df15
|
data/lib/cli/install.rb
CHANGED
@@ -19,22 +19,11 @@ command :install do |c|
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def install(game, path, steam_user, steam_password)
|
22
|
-
puts "Beginning
|
23
|
-
install_path = if path.nil?
|
24
|
-
puts "Install path was not provided: defaulting to /opt/#{game.name}".yellow
|
25
|
-
"/opt/#{game.name}"
|
26
|
-
else
|
27
|
-
path
|
28
|
-
end
|
29
|
-
steam_login = if steam_user.nil?
|
30
|
-
"+login anonymous"
|
31
|
-
else
|
32
|
-
"+login #{steam_user} #{steam_password}"
|
33
|
-
end
|
22
|
+
puts "Beginning to install dedicated server for #{game}. This may take a while...".blue
|
34
23
|
system("rm -f #{"/tmp/#{game.name}.service"}")
|
35
24
|
system("rm -f /etc/systemd/system/#{game.name}.service")
|
36
25
|
GameTemplate.new(game)
|
37
26
|
.install(Helpers.get_install_path(path, game.name),
|
38
27
|
Helpers.get_steamcmd_login(steam_user, steam_password))
|
39
|
-
puts "
|
28
|
+
puts "Dedicated server installation for #{game} complete. Check the output for messages or warnings.".green
|
40
29
|
end
|
data/lib/cli/update.rb
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
require "commander/import"
|
4
4
|
require "game_template"
|
5
5
|
require "cli/game_hash"
|
6
|
+
require "helpers"
|
6
7
|
|
7
8
|
command :update do |c|
|
8
9
|
c.syntax = "gsd update [args] [options]"
|
@@ -12,25 +13,21 @@ command :update do |c|
|
|
12
13
|
c.option "--steamuser OPTIONAL", String, "Steam user account required to install certain games."
|
13
14
|
c.option "--steampassword OPTIONAL", String, "Steam account password for installing certain games."
|
14
15
|
c.action do |args, options|
|
15
|
-
|
16
|
+
game = game_hash[args.first()]
|
17
|
+
abort("Non-Steam games not supported at this time 😞") if (game.app_id.nil?)
|
18
|
+
update(game, options.path, options.steamuser, options.steampassword)
|
16
19
|
end
|
17
20
|
end
|
18
21
|
|
22
|
+
# Update is functionally the same as install at this point because
|
23
|
+
# Servers installed via steamcmd are simply "reinstalled" to update them
|
24
|
+
# Non-steamcmd servers are not supported at this point (thats a 0.3.0 thing)
|
19
25
|
def update(game, path, steam_user, steam_password)
|
20
|
-
puts "Beginning
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
steam_login = if steam_user.nil?
|
28
|
-
"+login anonymous"
|
29
|
-
else
|
30
|
-
"+login #{steam_user} #{steam_password}"
|
31
|
-
end
|
32
|
-
system("rm -f #{"/tmp/#{@game.name}.service"}")
|
33
|
-
system("rm -f /etc/systemd/system/#{@game.name}.service")
|
34
|
-
GameTemplate.new(game).install(install_path, steam_login)
|
35
|
-
puts "Server installation & deployment complete!".green
|
26
|
+
puts "Beginning #{game} server update. This may take a while...".blue
|
27
|
+
system("rm -f #{"/tmp/#{game.name}.service"}")
|
28
|
+
system("rm -f /etc/systemd/system/#{game.name}.service")
|
29
|
+
GameTemplate.new(game)
|
30
|
+
.install(Helpers.get_install_path(path, game.name),
|
31
|
+
Helpers.get_steamcmd_login(steam_user, steam_password))
|
32
|
+
puts "#{game} server update complete. Check the output for messages or warnings.".green
|
36
33
|
end
|
data/lib/cli.rb
CHANGED
data/lib/game_template.rb
CHANGED
@@ -55,14 +55,6 @@ class GameTemplate
|
|
55
55
|
create_unit_file(install_path)
|
56
56
|
end
|
57
57
|
|
58
|
-
def update(install_path)
|
59
|
-
if @game.app_id.nil?
|
60
|
-
puts "Non-Steam games not supported."
|
61
|
-
else
|
62
|
-
install_steam_server(install_path)
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
58
|
private
|
67
59
|
|
68
60
|
# Installs or Updates a dedicated game server via Steamcmd
|