share_cli 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/share +4 -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: b7f231401bf54795bd7dde3454ed9bad4e5709b5
|
4
|
+
data.tar.gz: 6933f2494c89afa79cf41aaa82c372b5112413bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b42e94d3bc9dfd04b1d395314269ffdec15d004d2d9007d291d0e5f4e408384dcdcd983383a4025da5449f8917995bc21cbe895393b0b9ea35ce27a44d26bcfa
|
7
|
+
data.tar.gz: 0075f1f377e7f5a2e245e009cc65d639648152551d118289d1e57af4c96b6c77ea2d59a5f2eb61a207e70aaef0d052a7ed53ea2353b4ede5710ba2a6ab6f1484
|
data/bin/share
CHANGED
@@ -9,6 +9,7 @@ class Share < Thor
|
|
9
9
|
|
10
10
|
desc "get FILE", "Download file from S3"
|
11
11
|
def get(file)
|
12
|
+
file = file.gsub(/\s+/, "")
|
12
13
|
sha = Digest::SHA1.hexdigest(file+"037605")
|
13
14
|
command = "aws s3 cp s3://xnh/public/#{sha}/#{file} #{file} && echo '#{file}'"
|
14
15
|
exec(command)
|
@@ -16,7 +17,8 @@ class Share < Thor
|
|
16
17
|
|
17
18
|
desc "post FILE", "Post file to S3"
|
18
19
|
def post(file = nil)
|
19
|
-
|
20
|
+
file = file.gsub(/\s+/, "")
|
21
|
+
unless File.exists? file
|
20
22
|
puts "Error! Can't find \"#{file}\""
|
21
23
|
end
|
22
24
|
location = "#{Dir.pwd}/#{file}"
|
@@ -28,6 +30,7 @@ class Share < Thor
|
|
28
30
|
|
29
31
|
desc "delete FILE", "Delete file from S3"
|
30
32
|
def delete(file = nil)
|
33
|
+
file = file.gsub(/\s+/, "")
|
31
34
|
unless File.exists? file
|
32
35
|
puts "Error! Can't find \"#{file}\""
|
33
36
|
end
|