dotstore 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/dotstore +37 -0
- metadata +67 -0
data/bin/dotstore
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'fileutils'
|
3
|
+
|
4
|
+
home_dir = File.expand_path('~') + '/'
|
5
|
+
dotstore_dir = home_dir + '.dotstore/'
|
6
|
+
|
7
|
+
unless File.exists?(dotstore_dir)
|
8
|
+
print "#{home_dir}.dotstore does not exist.\n"
|
9
|
+
exit
|
10
|
+
end
|
11
|
+
|
12
|
+
|
13
|
+
Dir.foreach(dotstore_dir) do |f|
|
14
|
+
next if ['.', '..', '.git'].include?(f)
|
15
|
+
next unless f.match( /^\./ ) # dotfiles only
|
16
|
+
puts "\n== #{f} =="
|
17
|
+
file = dotstore_dir + f
|
18
|
+
target = home_dir + f
|
19
|
+
|
20
|
+
if File.symlink? target
|
21
|
+
if file == File.readlink(target)
|
22
|
+
puts " #{f} is already dotstorified!"
|
23
|
+
else
|
24
|
+
puts " ERROR: #{f} is symlinked elsewhere, we're not changing it!"
|
25
|
+
end
|
26
|
+
next
|
27
|
+
end
|
28
|
+
|
29
|
+
if File.exists?(target)
|
30
|
+
backup = f + '-' + Time.now.to_i.to_s
|
31
|
+
puts " #{f} exists. Backing it up to #{backup}"
|
32
|
+
FileUtils.mv( target, home_dir + backup )
|
33
|
+
end
|
34
|
+
|
35
|
+
puts " dotstorifying #{f}\n"
|
36
|
+
File.symlink(file, target)
|
37
|
+
end
|
metadata
ADDED
@@ -0,0 +1,67 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: dotstore
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 29
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 1
|
10
|
+
version: 0.0.1
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- John Joseph Bachir
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2010-12-10 00:00:00 -05:00
|
19
|
+
default_executable:
|
20
|
+
dependencies: []
|
21
|
+
|
22
|
+
description:
|
23
|
+
email: j@jjb.cc
|
24
|
+
executables:
|
25
|
+
- dotstore
|
26
|
+
extensions: []
|
27
|
+
|
28
|
+
extra_rdoc_files: []
|
29
|
+
|
30
|
+
files:
|
31
|
+
- bin/dotstore
|
32
|
+
has_rdoc: true
|
33
|
+
homepage: https://github.com/jjb/dostore/
|
34
|
+
licenses: []
|
35
|
+
|
36
|
+
post_install_message:
|
37
|
+
rdoc_options: []
|
38
|
+
|
39
|
+
require_paths:
|
40
|
+
- .
|
41
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
43
|
+
requirements:
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
hash: 3
|
47
|
+
segments:
|
48
|
+
- 0
|
49
|
+
version: "0"
|
50
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
51
|
+
none: false
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
hash: 3
|
56
|
+
segments:
|
57
|
+
- 0
|
58
|
+
version: "0"
|
59
|
+
requirements: []
|
60
|
+
|
61
|
+
rubyforge_project: dotstore
|
62
|
+
rubygems_version: 1.3.7
|
63
|
+
signing_key:
|
64
|
+
specification_version: 3
|
65
|
+
summary: dotstore is an easy way to keep your dotfiles in synch between computers, using git for all the things that make sense to use git for, and scripts for the rest.
|
66
|
+
test_files: []
|
67
|
+
|