gsd-cli 0.1.20 → 0.1.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/cli.rb +2 -2
- data/lib/game_template.rb +3 -3
- data/lib/helpers.rb +10 -0
- 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: b93ab95feadd37651966f4a242c53c01ff2e14de697f0f2cae15905fcf93c685
|
4
|
+
data.tar.gz: f1449137de6ad8249ab80799d9102c291087ada390f05adffa771ec2c5a045fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f7f1b1371bd89f0238a169aca119b55bd41c9f9691063999731956f40c98ac4a985a39e695515b77e9472da7dfe4cb4ece48db14a5446c92ecf8628d885283c
|
7
|
+
data.tar.gz: 1180a0b6a63158bebfa5bea10a0c5b8cea31a962c58e8dcb1289ae23395a6563909494e01b9822fe2c4f3726497ab150cea857f21e4d6e49ad9f9a3e44981597
|
data/lib/cli.rb
CHANGED
@@ -31,7 +31,7 @@ end
|
|
31
31
|
@games = userdata
|
32
32
|
|
33
33
|
program :name, "gsd-cli"
|
34
|
-
program :version, "0.1.
|
34
|
+
program :version, "0.1.21"
|
35
35
|
program :description, "A cli tool to deploy & manage dedicated game servers on Linux"
|
36
36
|
|
37
37
|
command :install do |c|
|
@@ -66,7 +66,7 @@ command :update do |c|
|
|
66
66
|
c.description = "Updates an installed dedicated game server."
|
67
67
|
c.option "--path STRING", String, "Path that the game server will be update to."
|
68
68
|
c.action do |args, options|
|
69
|
-
GameTemplate.new(@games[args.first()], options.path).update()
|
69
|
+
GameTemplate.new(@games[args.first()], options.path).update(options.path)
|
70
70
|
end
|
71
71
|
end
|
72
72
|
|
data/lib/game_template.rb
CHANGED
@@ -61,18 +61,18 @@ class GameTemplate
|
|
61
61
|
create_unit_file(cli_path, install_path)
|
62
62
|
end
|
63
63
|
|
64
|
-
def update
|
64
|
+
def update(install_path)
|
65
65
|
if @game.app_id.nil?
|
66
66
|
puts "Non-Steam games not supported."
|
67
67
|
else
|
68
|
-
install_steam_server()
|
68
|
+
install_steam_server(install_path)
|
69
69
|
end
|
70
70
|
end
|
71
71
|
|
72
72
|
private
|
73
73
|
|
74
74
|
# Installs or Updates a dedicated game server via Steamcmd
|
75
|
-
def install_steam_server(install_path, steamuser = nil, steampassword = nil)
|
75
|
+
def install_steam_server(install_path = "/tmp/#{@game.name}", steamuser = nil, steampassword = nil)
|
76
76
|
login = if steamuser.nil?
|
77
77
|
"+login anonymous"
|
78
78
|
else
|
data/lib/helpers.rb
CHANGED
@@ -4,4 +4,14 @@ module Helpers
|
|
4
4
|
def self.remote_cmd(connection, command)
|
5
5
|
system("ssh #{connection} '#{command}'")
|
6
6
|
end
|
7
|
+
|
8
|
+
def self.steamcmd_exists?(path = "/usr/games/steamcmd", binary = "steamcmd")
|
9
|
+
if system("stat #{path}")
|
10
|
+
true
|
11
|
+
elsif system("which #{binary}")
|
12
|
+
true
|
13
|
+
else
|
14
|
+
false
|
15
|
+
end
|
16
|
+
end
|
7
17
|
end
|