kiip 0.1.0 → 0.1.1

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
  SHA1:
3
- metadata.gz: f4ab9e25cf98311ac78915be7ce6aba963bdb64a
4
- data.tar.gz: a536f1b403b2f5e4e7f8264c8f5ebcb8868275f0
3
+ metadata.gz: 93e5818f0a0325b3bcf27992b9625999ee7fd84b
4
+ data.tar.gz: 680475d12c6fff02f03712998dd18f3737c31d64
5
5
  SHA512:
6
- metadata.gz: 96b847ef907d0eb154d6ffba1b219626c60357f83af004a5b2deaeae0bdc7e84f2b11bfee96b766cb9965811074f596fda86cdcc2795b62884e0aa8590d5efb6
7
- data.tar.gz: 96f01e0048f93dbc855e2dcdf8b61cb688aaca0c901cf9d6860ddfa3990f772c57ca330fc855f5e7f5c74461d205b0535d0f3d45a4b76b593f286fd611d4208c
6
+ metadata.gz: ff4a62f82c33481ac4b599aff38ca7b820190dad8fd48ee6b09b9f6cf103189a0066973c06d06806767c4d5ad60d02b02f8481dbac92abd8199e7d9a51f73b67
7
+ data.tar.gz: 510ff324195741f64c08702b83495fa2af27bd02d584e457b5168975695a331a42a38fb9bef0b7a2b3800c1f2417572304866bc017e058aec314eb3b961f793c
@@ -21,10 +21,16 @@ module Kiip::Tasks
21
21
  # actually execute the task
22
22
  def exec!
23
23
  return initialize! unless File.exists? target
24
+ if File.symlink? source
25
+ return if File.readlink(source) == target
24
26
 
25
- return create_symlink_from_source_to_target unless File.exists? source
27
+ if cli.agree "#{source} already exists, linking to #{File.readlink(source)}. Replace?"
28
+ remove_source
29
+ end
30
+ end
26
31
 
27
- return if File.symlink? source and File.readlink(source) == target
32
+
33
+ return create_symlink_from_source_to_target unless File.exists? source
28
34
 
29
35
  if cli.agree "#{source} already exists. Replace with symlink?"
30
36
  remove_source
@@ -55,7 +61,10 @@ module Kiip::Tasks
55
61
  end
56
62
 
57
63
  def remove_source
58
- FileUtils.rm_f(source, verbose: is_verbose, noop: is_dry)
64
+ # only force on real directories
65
+ do_force = !File.symlink?(source) and File.directory?(source)
66
+
67
+ FileUtils.rm(source, verbose: is_verbose, noop: is_dry, force: do_force)
59
68
  end
60
69
 
61
70
  def move_source_to_target
data/lib/kiip/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Kiip
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kiip
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
  - Robin Wenglewski