ln4sudo 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -1
- data/exe/ln4sudo +12 -2
- data/lib/ln4sudo/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d81611791367f47f236e6af564a8f2bc0e6ed08bd1d7d6b2dbb77061f7c5829e
|
4
|
+
data.tar.gz: 221b67e8fe6074d69ff0c8293e65efcb2a36e530eb4332eb5fd50064478a28e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e9a15b0f6e4537346cac59420ef88f72799b853aadb4a000fbca467ab7556ea45fbc642834bbf9acc9e20b2a0d8422ba18ee135fbb270c86731698d2d634170
|
7
|
+
data.tar.gz: ccb53d57317388f7f98f9b1137347623ca264d8378e6f0b2bc27caa131bbc8d4b996ed476a6887ff74a3147528832dede01329e5252ef4c1ece1089b02e6695c
|
data/README.md
CHANGED
@@ -10,6 +10,10 @@ ln4sudo - create a symbolic link in /sbin for easy sudo.
|
|
10
10
|
## Usage
|
11
11
|
|
12
12
|
```
|
13
|
+
ln4sudo [-f] command...
|
14
|
+
|
15
|
+
-f remove existing destination files
|
16
|
+
|
13
17
|
$ which gem
|
14
18
|
/usr/local/ruby2.5.1/bin/gem
|
15
19
|
|
@@ -28,7 +32,7 @@ change target directory to /usr/local/sbin
|
|
28
32
|
|
29
33
|
## Contributing
|
30
34
|
|
31
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/s3fxn/ln4sudo.
|
32
36
|
|
33
37
|
## License
|
34
38
|
|
data/exe/ln4sudo
CHANGED
@@ -11,7 +11,9 @@ if ARGV == []
|
|
11
11
|
puts
|
12
12
|
puts 'ln4sudo - create a symbolic link in /sbin for easy sudo.'
|
13
13
|
puts
|
14
|
-
puts 'Usage: ln4sudo command...'
|
14
|
+
puts 'Usage: ln4sudo [-f] command...'
|
15
|
+
puts
|
16
|
+
puts '-f remove existing destination files'
|
15
17
|
puts
|
16
18
|
puts 'examples:'
|
17
19
|
puts '$ which gem'
|
@@ -39,6 +41,13 @@ if ARGV[0] == 'init' and FileTest.directory?(ARGV[1] || '')
|
|
39
41
|
exit
|
40
42
|
end
|
41
43
|
|
44
|
+
if ARGV.include?('-f')
|
45
|
+
force = 'f'
|
46
|
+
ARGV.delete('-f')
|
47
|
+
else
|
48
|
+
force = ''
|
49
|
+
end
|
50
|
+
|
42
51
|
dir = open(config).read.strip if FileTest.exists?(config)
|
43
52
|
dir = '/sbin' if dir == nil or dir == ''
|
44
53
|
ARGV.each {|cmd|
|
@@ -47,7 +56,8 @@ ARGV.each {|cmd|
|
|
47
56
|
puts "#{cmd} not found."
|
48
57
|
next
|
49
58
|
end
|
50
|
-
|
59
|
+
fullpath = File.readlink(fullpath) if FileTest.symlink?(fullpath)
|
60
|
+
sudo_cmd = "sudo ln -s#{force} #{fullpath} #{dir}"
|
51
61
|
puts sudo_cmd
|
52
62
|
print `#{sudo_cmd}`
|
53
63
|
}
|
data/lib/ln4sudo/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ln4sudo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- s3fxn
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-10-
|
11
|
+
date: 2018-10-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|