oneaws 0.1.2 → 0.1.3
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/lib/oneaws/cli.rb +17 -1
- data/lib/oneaws/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: 206db80babfc5a4ec457c5f4f6a3a5d39c27d80651174f23a527b93601c16f39
|
4
|
+
data.tar.gz: 0daa2f9d03f81cd2a43b0e5474b2987346b2fbf21b6824b8a7f7dc7c7642b096
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a43e2ccf892638a0565e1b81998c08367298f017e09bfb8c9013b8a9f71746e84607b95899fd09a96edeaec73cac4b7805a973e1119bc14a7ff3b21142fdfef
|
7
|
+
data.tar.gz: 8eb123cd6ad1130c70bdb8d085668a4b66f1fc4030d88861e722d1294a0f48a8d72fb51ff8029ee6150c90dc33a9067ce5fb65cec7c2b3f206374b551d5b3573
|
data/lib/oneaws/cli.rb
CHANGED
@@ -22,7 +22,7 @@ module Oneaws
|
|
22
22
|
credential = client.issue_credential(params)
|
23
23
|
|
24
24
|
if options["update_aws_credentials"]
|
25
|
-
credential_file = File.expand_path(
|
25
|
+
credential_file = File.expand_path(find_credentials)
|
26
26
|
unless inifile = IniFile.load(credential_file)
|
27
27
|
FileUtils.mkdir_p(File.dirname(credential_file))
|
28
28
|
inifile = IniFile.new
|
@@ -51,5 +51,21 @@ module Oneaws
|
|
51
51
|
EOS
|
52
52
|
end
|
53
53
|
end
|
54
|
+
|
55
|
+
private
|
56
|
+
|
57
|
+
# AWS の credential を以下の順番で存在チェックをする
|
58
|
+
# 1. ~/.aws/credentials
|
59
|
+
# 2. ~/.config/aws/credentials
|
60
|
+
# 存在しない場合は順番1つ目のものを用いる
|
61
|
+
def find_credentials
|
62
|
+
credentials = ["~/.aws/credentials", "~/.config/aws/credentials"]
|
63
|
+
credential = credentials.find{|c| File.exists? File.expand_path(c) }
|
64
|
+
if credential
|
65
|
+
credential
|
66
|
+
else
|
67
|
+
credentials.first
|
68
|
+
end
|
69
|
+
end
|
54
70
|
end
|
55
71
|
end
|
data/lib/oneaws/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oneaws
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuki Koya
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-10-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|