gsd-cli 0.1.36 → 0.1.37

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: a4417b24df4b4171f873c04ce91aac0a59b45992f28893ef8e68c91728b1eb1e
4
- data.tar.gz: a18213aeaf377b85fc21e123ef833b2f0e36ee53020457b368a81c9805c16c51
3
+ metadata.gz: fb2a7ef9ed40017c0d6cab79fb2c434989ac1dc4e6ab027904aafcc01281ac5b
4
+ data.tar.gz: 6ccd788aa9310e88992ba6ec4a111bd539401aa28415e932b864711573909971
5
5
  SHA512:
6
- metadata.gz: bb8cdf33508f4f603f9864f516ed245c4fa2a7025df9ab94d882072c360e8e7ae5fb88a28b8947c31488218f48616ef044cba764ad3ee736be68bb8ec63d2dce
7
- data.tar.gz: c23a618aa2c69e6b718562fd8b6777d563a655b048f0ba201a84293214fe70890654fb90b8cd33600a0f874273e3f1e16a95eb1c9c51affd4108fb3a6a2cd3fc
6
+ metadata.gz: 5c55390d49d52801d978d2036692f0ec2ce04c3da9253ae64c49a8307d361fb8030451f83b15d5d954f72a814a694e17ef8f7ea9df455d53c4ed7ad5c8709577
7
+ data.tar.gz: e98b4fa209ea41423b92e0c80a0b4df1aa8d39f0f5fd742f467b055e2e6d9c678022f361a1fb79b097a9f4df17cf1d748cb6cd4979e121739052ac2ef75c33dd
data/lib/cli/install.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 :install do |c|
8
9
  c.syntax = "gsd install [args] [options]"
@@ -18,7 +19,7 @@ command :install do |c|
18
19
  end
19
20
 
20
21
  def install(game, path, steam_user, steam_password)
21
- puts "Beginning installation process. This may take a while...".yellow
22
+ puts "Beginning installation process. This may take a while...".blue
22
23
  install_path = if path.nil?
23
24
  puts "Install path was not provided: defaulting to /opt/#{game.name}".yellow
24
25
  "/opt/#{game.name}"
@@ -30,8 +31,10 @@ def install(game, path, steam_user, steam_password)
30
31
  else
31
32
  "+login #{steam_user} #{steam_password}"
32
33
  end
33
- system("rm -f #{"/tmp/#{@game.name}.service"}")
34
- system("rm -f /etc/systemd/system/#{@game.name}.service")
35
- GameTemplate.new(game).install(install_path, steam_login)
36
- puts "Server installation & deployment complete!".green
34
+ system("rm -f #{"/tmp/#{game.name}.service"}")
35
+ system("rm -f /etc/systemd/system/#{game.name}.service")
36
+ GameTemplate.new(game)
37
+ .install(Helpers.get_install_path(path, game.name),
38
+ Helpers.get_steamcmd_login(steam_user, steam_password))
39
+ puts "Server installation complete. Check the output for messages or warnings.".green
37
40
  end
data/lib/cli/update.rb CHANGED
@@ -14,4 +14,23 @@ command :update do |c|
14
14
  c.action do |args, options|
15
15
  GameTemplate.new(game_hash[args.first()], options.path).update(options.path)
16
16
  end
17
+ end
18
+
19
+ def update(game, path, steam_user, steam_password)
20
+ puts "Beginning installation process. This may take a while...".yellow
21
+ install_path = if path.nil?
22
+ puts "Install path was not provided: defaulting to /opt/#{game.name}".yellow
23
+ "/opt/#{game.name}"
24
+ else
25
+ path
26
+ end
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
17
36
  end
data/lib/cli.rb CHANGED
@@ -3,7 +3,7 @@
3
3
  require "commander/import"
4
4
 
5
5
  program :name, "gsd-cli"
6
- program :version, "0.1.36"
6
+ program :version, "0.1.37"
7
7
  program :description, "A cli tool to deploy & manage dedicated game servers on Linux"
8
8
 
9
9
  require "cli/install"
data/lib/helpers.rb CHANGED
@@ -14,4 +14,23 @@ module Helpers
14
14
  false
15
15
  end
16
16
  end
17
+
18
+ def self.get_install_path(path, game)
19
+ install_path = if path.nil?
20
+ puts "Install path was not provided: defaulting to /opt/#{game}".yellow
21
+ "/opt/#{game}"
22
+ else
23
+ path
24
+ end
25
+ install_path
26
+ end
27
+
28
+ def self.get_steamcmd_login(steam_user, steam_password)
29
+ steam_login = if steam_user.nil?
30
+ "+login anonymous"
31
+ else
32
+ "+login #{steam_user} #{steam_password}"
33
+ end
34
+ steam_login
35
+ end
17
36
  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.36
4
+ version: 0.1.37
5
5
  platform: ruby
6
6
  authors:
7
7
  - Egee