marseditsync 0.1.0 → 0.2.0

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: d48c5cd4cf70c0dddff5ca4e8d6adce2d90eb72b
4
- data.tar.gz: f4579971635d2fd5ad324520d60bc62c248067bc
3
+ metadata.gz: cf87078a31046308a7a167e7c0f0a03035f8f20a
4
+ data.tar.gz: 307e4023c3868be54eb1f0bdaec598c0062d1bdb
5
5
  SHA512:
6
- metadata.gz: a743de8d855c54bee86a975c2e8f63e63a38a489f833609ce38cbe4f73f474e8c3365209f5e3fc2a7366e634132002ba1798322fbb681fbea3b6c1e15bb4cf85
7
- data.tar.gz: e366c39b48095a911d5344eca9e57348156148cdb09cfebe8b9d16b696c334f45d66547596c06eed7ae5f6f3ad8b13683d21d4488b38c8056ac6ea1e2b3f1b3e
6
+ metadata.gz: ed52490fc4b49a38d291a393b27a5b2631ecb9122de4e6413db27db1bc4a173f190bf14822af6b3d736920109b660f3ca3d483f7124d94010aaa464aa8a59261
7
+ data.tar.gz: 2b7dee005cf2b649df7fc82e39cd5aefaa09db178baa723d7c5ed90d106fafd2812e21c98710848e26cc1e5bc38dabaaf7559ffb09663aee03ee18318df41516
data/lib/marseditsync.rb CHANGED
@@ -194,15 +194,17 @@ module Marseditsync
194
194
  srcdir = File.join(DROPBOX_DIR, link_dir)
195
195
  dstdir = File.join(MARSEDIT_DIR, link_dir)
196
196
  timestamp = Time.now.strftime("%Y%m%d_%H%M%S")
197
- if FileTest.directory?(srcdir)
198
- if FileTest.directory?(dstdir)
197
+ if FileTest.directory?(srcdir)
198
+ if FileTest.directory?(dstdir) && !FileTest.symlink?(dstdir)
199
199
  # オリジナルはバックアップとして残す(なぜか他の親フォルダにmvできない?)
200
200
  backupdir = File.join(MARSEDIT_DIR, link_dir + '_' + timestamp)
201
201
  puts "mv #{dstdir} #{backupdir}"
202
202
  FileUtils.mv(dstdir, backupdir)
203
203
  end
204
- puts "ln #{srcdir} #{dstdir}"
205
- FileUtils.symlink(srcdir, dstdir)
204
+ unless FileTest.symlink?(dstdir)
205
+ puts "ln #{srcdir} #{dstdir}"
206
+ FileUtils.symlink(srcdir, dstdir)
207
+ end
206
208
  end
207
209
  end
208
210
  true
@@ -1,3 +1,3 @@
1
1
  module Marseditsync
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: marseditsync
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - src