shaddox 0.0.14 → 0.0.15

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
  SHA1:
3
- metadata.gz: 57d55169746bf088a8f1808239e6bce9246bb3b2
4
- data.tar.gz: 1b1e3f67edf2df39bcb17d271fc0dcff7dc3111d
3
+ metadata.gz: 419b93e06f0b3d5e130fd8cee8a2d4e0dc1571c0
4
+ data.tar.gz: c4b3e19104c9f25a8a6575b84ba7fedc924b405c
5
5
  SHA512:
6
- metadata.gz: 91135741672ec330d1ec135f70a4d0e7cdc813b54683c7c12eaf2c61b701aab83bb5eaa02d1d713f6cc026a2a9a71083c3e75107c445d1ca9f6b9df942712f4c
7
- data.tar.gz: c9ea2e0fd3834a5f774f3c2741d89cb1a1ac2e5d8bc31a3d96ac8b1d87363f238c6774394576940321cdaf775762e0b9d43db787acf12af8bc967106a143e9cf
6
+ metadata.gz: 3ffcd10523a382ae5c6f68a714ceae7cbe0cab7ec9772f0fa76560e0ea0e3febe61b9ff6be2e36a0d94525e82144038d6780b36637a732476feb2a9d468e21f0
7
+ data.tar.gz: a92844b5bb77ed1f009a1a053eae6e8a3ebca19eacc08ed60828856fd657b3fd1ebbd8a163fd1cf1181fead39400ea4c0cd06ca5fabf6fb8f7383abe51213f23
@@ -53,7 +53,15 @@ module Shaddox
53
53
  FileUtils::mkdir_p(path.exp_path)
54
54
  end
55
55
 
56
+ def ensure_git()
57
+ unless @git_installed
58
+ install 'git'
59
+ @git_installed = true
60
+ end
61
+ end
62
+
56
63
  def repo_clone(repo_key, path)
64
+ ensure_git()
57
65
  repo = @repos[repo_key]
58
66
  cd path do
59
67
  case repo.vcs
@@ -78,7 +86,8 @@ module Shaddox
78
86
  end
79
87
  raise "No installer specified for this target!" unless @installer
80
88
  info "Ensuring #{package} is installed with #{@installer}", 1 if @verbose
81
- unless system("type #{package} >/dev/null 2>&1")
89
+ package_installed = lambda { system("type #{package} >/dev/null 2>&1") }
90
+ unless package_installed.call()
82
91
  case @installer
83
92
  when :apt
84
93
  sh "sudo apt-get install -y #{package}"
@@ -86,6 +95,7 @@ module Shaddox
86
95
  sh "brew install #{package}"
87
96
  end
88
97
  end
98
+ raise "#{package} could not be installed." unless package_installed.call()
89
99
  end
90
100
  end
91
101
  end
@@ -121,6 +121,7 @@ module Shaddox
121
121
  end
122
122
  end
123
123
  def exec(command, opts = {})
124
+ require 'highline/import'
124
125
  exit_code = nil
125
126
  @ssh.open_channel do |channel|
126
127
  channel.request_pty do |c, success|
@@ -130,8 +131,7 @@ module Shaddox
130
131
  if data =~ /\[sudo\]/ || data =~ /Password/i
131
132
  warn "Target is asking for password: ", 1
132
133
  $stdout.print data
133
- puts ""
134
- pass = $stdin.gets.chomp
134
+ pass = ask("") { |q| q.echo = false }
135
135
  channel.send_data "#{pass}\n"
136
136
  else
137
137
  $stdout.print data unless opts[:quiet]
@@ -1,3 +1,3 @@
1
1
  module Shaddox
2
- VERSION = "0.0.14"
2
+ VERSION = "0.0.15"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shaddox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.14
4
+ version: 0.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - joshglendenning