appydave-tools 0.22.0 → 0.24.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 93dd9f15e347dfb0b0cb8bc5897e936317cbc8af13af40d3b51fd912d9c7cb7b
4
- data.tar.gz: a7b21ab65386f0291c584263f0247513b4ad35513246e68bf873330e70221836
3
+ metadata.gz: f804cce4dd83a357489fe3163e014593fc173888c8c5acb2f64c766b01030203
4
+ data.tar.gz: d1b0edb7dc10a3968fb803eb1a7584459d9d51dc64754e1b8cc7f1901a1c6793
5
5
  SHA512:
6
- metadata.gz: 54f08c9a7b2d340fbe0a6600b239a0fa02bb3e7d869923bcf5ddb8e29ed911f3aac066ae358f078c07f9f75d9025464b10fd355bf245125c7ab6ba4e279d0b02
7
- data.tar.gz: bf5358fd24eb33c6533ba6593c3195d45285d6f5ad5e926d4db2a34ce3bb0b1fc7557cca4d4b5978b7c5171ef68c3ef20589ca2369e23a9a4479ccacb7ab7e61
6
+ metadata.gz: bd87280b7574f1a40690e48c5480c70db7f9aa8349b11d08b2e3977f46694eb285749b1e91ace744592f7a9f984545101577f0f39a43b96bca75c08e6c967840
7
+ data.tar.gz: d33a2f223ebc839a4b9d4a08ce93678e22e3383133db01802018bda97a1e26299965bfb2a0a6e2e315f2accd83c10e953b61ad8ed5d2d1062f4dc288d2a9d5c0
data/CHANGELOG.md CHANGED
@@ -1,3 +1,20 @@
1
+ # [0.23.0](https://github.com/appydave/appydave-tools/compare/v0.22.0...v0.23.0) (2025-11-19)
2
+
3
+
4
+ ### Features
5
+
6
+ * use current user's AWS profile for S3 operations ([3029aff](https://github.com/appydave/appydave-tools/commit/3029aff202ac8ee4a79e335ea7f3cbc246c7dd54))
7
+ * use current user's AWS profile for S3 operations instead of brand-specific profiles ([8eea669](https://github.com/appydave/appydave-tools/commit/8eea669b43f6017470edfcac4632c8cc4cca408d))
8
+
9
+ # [0.22.0](https://github.com/appydave/appydave-tools/compare/v0.21.2...v0.22.0) (2025-11-19)
10
+
11
+
12
+ ### Features
13
+
14
+ * fix remaining rubocop string literal issue ([a28b9be](https://github.com/appydave/appydave-tools/commit/a28b9bedc31777bf382ebdc54b0abd4e27b7609a))
15
+ * fix rubocop issues in S3 scanner implementation ([20e9d48](https://github.com/appydave/appydave-tools/commit/20e9d481843aa4ab622a3ce6e56ff1183e3bad27))
16
+ * implement S3 scanning to query AWS for actual file data ([f452f95](https://github.com/appydave/appydave-tools/commit/f452f9587ed94f25f100ff36682f9b9c4312b975))
17
+
1
18
  ## [0.21.2](https://github.com/appydave/appydave-tools/compare/v0.21.1...v0.21.2) (2025-11-17)
2
19
 
3
20
 
@@ -32,6 +32,10 @@ module Appydave
32
32
  get('download-image-folder') || download_folder
33
33
  end
34
34
 
35
+ def current_user
36
+ get('current_user')
37
+ end
38
+
35
39
  def print
36
40
  log.subheading 'Settings Configuration'
37
41
 
@@ -50,9 +50,31 @@ module Appydave
50
50
  Appydave::Tools::Configuration::Config.brands.get_brand(brand)
51
51
  end
52
52
 
53
+ # Determine which AWS profile to use based on current user
54
+ # Priority: current user's default_aws_profile > brand's aws.profile
55
+ def determine_aws_profile(brand_info)
56
+ # Get current user from settings (if available)
57
+ begin
58
+ current_user_key = Appydave::Tools::Configuration::Config.settings.current_user
59
+
60
+ if current_user_key
61
+ # Look up current user's default AWS profile
62
+ users = Appydave::Tools::Configuration::Config.brands.data['users']
63
+ user_info = users[current_user_key]
64
+
65
+ return user_info['default_aws_profile'] if user_info && user_info['default_aws_profile']
66
+ end
67
+ rescue Appydave::Tools::Error
68
+ # Config not available (e.g., in test environment) - fall through to brand profile
69
+ end
70
+
71
+ # Fallback to brand's AWS profile
72
+ brand_info.aws.profile
73
+ end
74
+
53
75
  def create_s3_client(brand_info)
54
- profile_name = brand_info.aws.profile
55
- raise "AWS profile not configured for brand '#{brand}'" if profile_name.nil? || profile_name.empty?
76
+ profile_name = determine_aws_profile(brand_info)
77
+ raise "AWS profile not configured for current user or brand '#{brand}'" if profile_name.nil? || profile_name.empty?
56
78
 
57
79
  credentials = Aws::SharedCredentials.new(profile_name: profile_name)
58
80
 
@@ -136,6 +158,12 @@ module Appydave
136
158
  project_dir = File.join(brand_path, project_id)
137
159
  staging_dir = File.join(project_dir, 's3-staging')
138
160
 
161
+ # Ensure project directory exists before download
162
+ unless Dir.exist?(project_dir)
163
+ puts "📁 Creating project directory: #{project_id}"
164
+ FileUtils.mkdir_p(project_dir) unless dry_run
165
+ end
166
+
139
167
  s3_files = list_s3_files
140
168
 
141
169
  if s3_files.empty?
@@ -84,9 +84,31 @@ module Appydave
84
84
  Appydave::Tools::Configuration::Config.brands.get_brand(brand)
85
85
  end
86
86
 
87
+ # Determine which AWS profile to use based on current user
88
+ # Priority: current user's default_aws_profile > brand's aws.profile
89
+ def determine_aws_profile(brand_info)
90
+ # Get current user from settings (if available)
91
+ begin
92
+ current_user_key = Appydave::Tools::Configuration::Config.settings.current_user
93
+
94
+ if current_user_key
95
+ # Look up current user's default AWS profile
96
+ users = Appydave::Tools::Configuration::Config.brands.data['users']
97
+ user_info = users[current_user_key]
98
+
99
+ return user_info['default_aws_profile'] if user_info && user_info['default_aws_profile']
100
+ end
101
+ rescue Appydave::Tools::Error
102
+ # Config not available (e.g., in test environment) - fall through to brand profile
103
+ end
104
+
105
+ # Fallback to brand's AWS profile
106
+ brand_info.aws.profile
107
+ end
108
+
87
109
  def create_s3_client(brand_info)
88
- profile_name = brand_info.aws.profile
89
- raise "AWS profile not configured for brand '#{@brand}'" if profile_name.nil? || profile_name.empty?
110
+ profile_name = determine_aws_profile(brand_info)
111
+ raise "AWS profile not configured for current user or brand '#{@brand}'" if profile_name.nil? || profile_name.empty?
90
112
 
91
113
  credentials = Aws::SharedCredentials.new(profile_name: profile_name)
92
114
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Appydave
4
4
  module Tools
5
- VERSION = '0.22.0'
5
+ VERSION = '0.24.0'
6
6
  end
7
7
  end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "appydave-tools",
3
- "version": "0.22.0",
3
+ "version": "0.24.0",
4
4
  "description": "AppyDave YouTube Automation Tools",
5
5
  "scripts": {
6
6
  "release": "semantic-release"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appydave-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.22.0
4
+ version: 0.24.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Cruwys