raz 0.1.0 → 0.1.1

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: cba3b8783105105a189f73b386f5423d4d9caf02
4
- data.tar.gz: 9e7e5e1d8d571359eaf8bbd01fcdb208b1dc2d5b
3
+ metadata.gz: 9441986fd2b7ac386917326d6d7fe60d4e7700d0
4
+ data.tar.gz: 5fe9b1c609e412ff3165ed6e61fc376d3100ab35
5
5
  SHA512:
6
- metadata.gz: 53214d6e8ecffa2a2837bf516aa370ceb74a3a6fa5e8c9e5eb15951d7a18d60ba67d93745c0eb2e8525d6fc09a0c501227716c15080a73c57ae943495d103dc3
7
- data.tar.gz: 1f63bae43ca5203167fba5b8ae74b3ace9f9ce976ac9dc0417f269023007a7a7eb3a41822924e16ab13a60f2e7f8e9fb535c1470d26f354d095757113bbd0019
6
+ metadata.gz: c1c1be3c9745d8d1279e16bb58dee1394fd5a0f004dacf01fd5d9491a3479218fa86994ad027ee3d853be2b531d8b486125f005336bacae72cb55d579a7145e6
7
+ data.tar.gz: abf4337d6a92a599ccb5d43d6ea6cc13d277d86b393a7d953ad3dd639376b92100bce9be7c4df7f177aaee887426a063333d007b1e1d1bddde727d20ce6c60d0
data/bin/raz CHANGED
@@ -9,11 +9,12 @@ require 'gli'
9
9
  include GLI::App
10
10
 
11
11
  program_desc 'Tool to backup and restore files.'
12
+ version Raz::VERSION
12
13
 
13
14
 
14
15
  on_error do |e|
15
16
  $stderr.puts "#{e.message}".red
16
- $stderr.puts "#{e.backtrace_locations.join("\n")}".red
17
+ $stderr.puts " from #{e.backtrace.join("\n from ")}".red unless e.is_a?(OptionParser::ParseError)
17
18
  end
18
19
 
19
20
 
@@ -39,11 +39,12 @@ module Raz
39
39
 
40
40
  if File.directory?(dest)
41
41
  FileOperations.dir_entries(src).each do |item|
42
- puts "Restoring file to #{File.join(src, item)}".green
43
- FileOperations.copy_item(File.join(src, item), File.join(dest, item))
42
+ puts "Restoring file to #{File.join(dest, item)}".green
43
+ FileOperations.copy_item(File.join(src, item), dest)
44
44
  end
45
45
  else
46
46
  FileUtils.rmtree(dest) if File.exist?(dest)
47
+ FileUtils.mkdir_p(File.dirname(dest))
47
48
 
48
49
  puts "Restoring item to #{dest}".green
49
50
  FileOperations.copy_item(src, dest)
@@ -51,7 +52,9 @@ module Raz
51
52
  end
52
53
 
53
54
  # restore config file to previous location
54
- FileOperations.copy_item(config.path, destination_path_from_original(@info[:orig_config_path]))
55
+ orig_config_path = destination_path_from_original(@info[:orig_config_path])
56
+ FileUtils.mkdir_p(File.dirname(orig_config_path))
57
+ FileOperations.copy_item(config.path, orig_config_path)
55
58
 
56
59
  # run after procs
57
60
  (config.procs[:after_restore] || []).each do |proc|
@@ -1,3 +1,3 @@
1
1
  module Raz
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: raz
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roman Kříž
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-08 00:00:00.000000000 Z
11
+ date: 2015-10-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gli