hak 0.5.0 → 0.5.2

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/hak +29 -5
  3. data/lib/hak/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 39247b79afce12fa6fc4bbf5b84f11c0b1e2ea12
4
- data.tar.gz: 9995bb233f2c21b25ee57f3feadf530e9d2d7e66
3
+ metadata.gz: 59036d5baab90eccfda9560822c1344bcd5bcd89
4
+ data.tar.gz: 18b22fa73884b8713ce8c543a642a0090af4e5d8
5
5
  SHA512:
6
- metadata.gz: 029ce0915368196f97dbb7e2755bc23bc9f6cf8bf16322fb767586a71b3ac1a90e10dce831376431ac4f9d7d274fe779be0296dd10f00a73ea99842eb54885c0
7
- data.tar.gz: ef78596b410707f26106c5c8519aba14ea8b4e77b065883b7a60844d2792211ddd658c268d0de6740199a74a58565b5ea8e9da6c1ade84bbdd3fb2d05ad5a5d7
6
+ metadata.gz: 512494f63e62bd716e6228896204663f05a0cef309106a5589d19475016fb0be48f0f353fb78c077f86b75e579af9f98241aeefdd1e06331080853296135d612
7
+ data.tar.gz: cc6cd146a93e1154e2d07bd1b0e9461db18c2173dad577fbe871d352757cf04a1e04f5061d758599b0ebfa1e61000b11064914cd3633f5a6554287cd8da3afb8
data/bin/hak CHANGED
@@ -7,7 +7,7 @@ require 'colorize'
7
7
  require 'highline'
8
8
 
9
9
  program :name, 'hak'
10
- program :version, '0.5.0'
10
+ program :version, '0.5.2'
11
11
  program :description, 'Hak - A Docker powered website manager for OSX'
12
12
 
13
13
  default_command :help
@@ -139,12 +139,12 @@ command :get do |c|
139
139
  c.action do |args, options|
140
140
 
141
141
  if args.empty?
142
- puts "type one of the following to get started: "
142
+ puts "for more hak-ready packages, check out https://hak.sh/".yellow
143
+ puts "type one of the following to get started: ".yellow
143
144
  puts "hak get jaequery/react-starter"
144
145
  puts "hak get jaequery/honeybadger"
145
146
  puts " "
146
- puts "for more hak-ready packages, check out https://hak.sh/"
147
-
147
+
148
148
  else
149
149
  repo = args[0]
150
150
  folder = args[1]
@@ -187,6 +187,7 @@ command :start do |c|
187
187
  c.description = 'this starts up the website'
188
188
  c.example 'description', 'hak start'
189
189
  c.action do |args, options|
190
+ check_docker
190
191
  run "docker-compose up -d && docker-compose logs -f"
191
192
  end
192
193
  end
@@ -197,6 +198,7 @@ command :stop do |c|
197
198
  c.description = 'stops the site'
198
199
  c.example 'description', 'hak stop'
199
200
  c.action do |args, options|
201
+ check_docker
200
202
  run "docker-compose stop"
201
203
  end
202
204
  end
@@ -207,6 +209,7 @@ command :restart do |c|
207
209
  c.description = 'restarts the site'
208
210
  c.example 'description', 'hak restart'
209
211
  c.action do |args, options|
212
+ check_docker
210
213
  run "docker-compose stop"
211
214
  run "docker-compose up -d && docker-compose logs -f"
212
215
  end
@@ -218,7 +221,8 @@ command :rm do |c|
218
221
  c.description = 'deletes docker containers for the project'
219
222
  c.example 'description', 'hak rm'
220
223
  c.action do |args, options|
221
- run "docker-compose rm -f --all"
224
+ check_docker
225
+ run "docker-compose stop && docker-compose rm -f --all"
222
226
  end
223
227
  end
224
228
 
@@ -228,6 +232,7 @@ command :logs do |c|
228
232
  c.description = ''
229
233
  c.example 'description', 'hak logs'
230
234
  c.action do |args, options|
235
+ check_docker
231
236
  run "docker-compose logs -f"
232
237
  end
233
238
  end
@@ -239,6 +244,7 @@ command :ssh do |c|
239
244
  c.description = ''
240
245
  c.example 'description', 'hak ssh [app]'
241
246
  c.action do |args, options|
247
+ check_docker
242
248
 
243
249
  file_name = 'docker-compose.yml'
244
250
  config_options = YAML.load_file(file_name)
@@ -267,6 +273,8 @@ command :ps do |c|
267
273
  c.description = ''
268
274
  c.example 'description', 'hak ps'
269
275
  c.action do |args, options|
276
+ check_docker
277
+
270
278
  container_names = run('docker ps --format "{{.Names}}"', true)
271
279
  lines = container_names.lines
272
280
  dinghy_running = false
@@ -397,3 +405,19 @@ def run(command, hide=false)
397
405
 
398
406
  return res
399
407
  end
408
+
409
+ def check_docker
410
+
411
+ res = `dinghy status`
412
+ if res.include? "VM: stopped"
413
+ running = false
414
+ puts "docker not running or stopped".yellow
415
+ puts "type this to power it on:".yellow
416
+ puts "hak on"
417
+ abort
418
+ else
419
+ running = true
420
+ end
421
+
422
+ return running
423
+ end
data/lib/hak/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Hak
2
- VERSION = "0.5.0"
2
+ VERSION = "0.5.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hak
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - jaequery