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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2913916fc6af6c39b124d8d34efc4d5d0f6c945f458cfc7fddfbdacb744dde16
4
- data.tar.gz: 93fb5540d532d8651adfda1a7aec583a25d185a6ff42dc223e8c594e8383ccfb
3
+ metadata.gz: b93ab95feadd37651966f4a242c53c01ff2e14de697f0f2cae15905fcf93c685
4
+ data.tar.gz: f1449137de6ad8249ab80799d9102c291087ada390f05adffa771ec2c5a045fc
5
5
  SHA512:
6
- metadata.gz: 5c4302f60938f10f6c7f7efd1369c38e8d067814b85979f7267178f3d8fecdcbc720ff9bbe0dfa3ab744e16bc12ecbb8d30046a95562ad0aaef22939d92179bd
7
- data.tar.gz: f798000d839c7ee906cb4b70b5fe77a689f90f9dc5e4859542f643c9d3ca181ee3483cf83da0aed0d896da4f8b52bb21644e851543f7f4270931a961b1ca4dca
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.20"
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gsd-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.20
4
+ version: 0.1.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Egee