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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fb2a7ef9ed40017c0d6cab79fb2c434989ac1dc4e6ab027904aafcc01281ac5b
4
- data.tar.gz: 6ccd788aa9310e88992ba6ec4a111bd539401aa28415e932b864711573909971
3
+ metadata.gz: 7f63083cd5b8d265941eb98bc7d015101ed1168f9a04953cd32fedbf883abd88
4
+ data.tar.gz: 47705f05da2f10c015f279a3f28ecbd72a13090c194096b5687171c0e83ee9d9
5
5
  SHA512:
6
- metadata.gz: 5c55390d49d52801d978d2036692f0ec2ce04c3da9253ae64c49a8307d361fb8030451f83b15d5d954f72a814a694e17ef8f7ea9df455d53c4ed7ad5c8709577
7
- data.tar.gz: e98b4fa209ea41423b92e0c80a0b4df1aa8d39f0f5fd742f467b055e2e6d9c678022f361a1fb79b097a9f4df17cf1d748cb6cd4979e121739052ac2ef75c33dd
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 installation process. This may take a while...".blue
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 "Server installation complete. Check the output for messages or warnings.".green
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
- GameTemplate.new(game_hash[args.first()], options.path).update(options.path)
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 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
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
@@ -3,7 +3,7 @@
3
3
  require "commander/import"
4
4
 
5
5
  program :name, "gsd-cli"
6
- program :version, "0.1.37"
6
+ program :version, "0.1.39"
7
7
  program :description, "A cli tool to deploy & manage dedicated game servers on Linux"
8
8
 
9
9
  require "cli/install"
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
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.37
4
+ version: 0.1.39
5
5
  platform: ruby
6
6
  authors:
7
7
  - Egee