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 +4 -4
- data/lib/marseditsync.rb +6 -4
- data/lib/marseditsync/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf87078a31046308a7a167e7c0f0a03035f8f20a
|
4
|
+
data.tar.gz: 307e4023c3868be54eb1f0bdaec598c0062d1bdb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
205
|
-
|
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
|
data/lib/marseditsync/version.rb
CHANGED