appydave-tools 0.40.0 → 0.42.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: 9610c23fa022740f9082e2bd0086bf7727cfe96437309b099a1bc5fbe55f58ea
4
- data.tar.gz: d556ee4ced131cfc9f7b8244edf9c2c464d5d3692a669cb0f7102831fccf1689
3
+ metadata.gz: 1f44cb8148a1bcc045a23b0f4b88a1b76c9a609756572bffa4c5796d6d003df3
4
+ data.tar.gz: 20125e106e76f74440295f46e50d2e7b413776c9424811d1552383a0f278541b
5
5
  SHA512:
6
- metadata.gz: f337f930defe037888a8ebc8dd19f6562519b39170b33a8944e68cc050059a65902d41c788d6cafa2c6132b2d2ee6f408ad54a420ce68c1bb74fb392ab9dc716
7
- data.tar.gz: f7f0933afa44c8e3a79aa3ceb6b53db950d0acb9e3b5ba17daf3acc46eafc97afd19071c0e335485d3345c08c9218c2285f5dcc0f74332bd87a3bf136a7dc210
6
+ metadata.gz: 3dccf3450efdd0d9b62dcc181b4d8e46144ddbc7eac989949efc777be721f9160facfcde563c72839791330f9b467e705bc0fc9fee166ee5ee6dfcd6b613fbfe
7
+ data.tar.gz: 24ad562b73095c83a79c8d51b3d35aa0ab027d724fb2e03059c0c4d41e078321d47c5d271f7c7e96fa52c226d08ede3b9e8eaa7992baad2dfc6c352e83befcdb
data/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ # [0.41.0](https://github.com/appydave/appydave-tools/compare/v0.40.0...v0.41.0) (2025-11-21)
2
+
3
+
4
+ ### Features
5
+
6
+ * improve DAM UX - better error messages, timestamps, and status display ([cba0cc7](https://github.com/appydave/appydave-tools/commit/cba0cc70851005a57331956df6b648c173bc0846))
7
+
8
+ # [0.40.0](https://github.com/appydave/appydave-tools/compare/v0.39.0...v0.40.0) (2025-11-21)
9
+
10
+
11
+ ### Features
12
+
13
+ * add S3 overwrite warnings with timestamp comparison to prevent data loss ([e922891](https://github.com/appydave/appydave-tools/commit/e922891d9ae87328f5a7cffe5e827f08232c90cc))
14
+
1
15
  # [0.39.0](https://github.com/appydave/appydave-tools/compare/v0.38.0...v0.39.0) (2025-11-21)
2
16
 
3
17
 
data/bin/dam CHANGED
@@ -34,12 +34,29 @@ class VatCLI
34
34
  }
35
35
  end
36
36
 
37
+ # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
37
38
  def run
38
39
  command, *args = ARGV
39
40
 
41
+ # Handle --version and -v flags
42
+ if ['--version', '-v'].include?(command)
43
+ puts "DAM (Digital Asset Management) v#{Appydave::Tools::VERSION}"
44
+ puts 'Part of appydave-tools gem'
45
+ exit
46
+ end
47
+
40
48
  if command.nil?
41
49
  puts 'DAM - Video Asset Tools'
50
+ puts "Version: #{Appydave::Tools::VERSION}"
51
+ puts ''
42
52
  puts 'Usage: dam [command] [options]'
53
+ puts ''
54
+ puts 'Common commands:'
55
+ puts ' dam list # List all brands'
56
+ puts ' dam list <brand> # List projects for a brand'
57
+ puts ' dam status <brand> # Show brand status'
58
+ puts ' dam s3-up <brand> <project> # Upload to S3'
59
+ puts ''
43
60
  puts "Run 'dam help' for more information."
44
61
  exit
45
62
  end
@@ -47,20 +64,31 @@ class VatCLI
47
64
  if @commands.key?(command)
48
65
  @commands[command].call(args)
49
66
  else
50
- puts "Unknown command: #{command}"
51
- puts "Run 'dam help' for available commands."
67
+ puts "Unknown command: #{command}"
68
+ puts ''
69
+ puts 'Available commands:'
70
+ puts ' list, status, manifest'
71
+ puts ' s3-up, s3-down, s3-status, s3-cleanup-remote, s3-cleanup-local'
72
+ puts ' archive, sync-ssd'
73
+ puts ' repo-status, repo-sync, repo-push'
74
+ puts ' s3-share, s3-discover, s3-scan'
75
+ puts ''
76
+ puts "Run 'dam help' for detailed information."
52
77
  exit 1
53
78
  end
54
79
  end
80
+ # rubocop:enable Metrics/AbcSize, Metrics/MethodLength
55
81
 
56
82
  private
57
83
 
58
84
  # Show help information
59
- # rubocop:disable Metrics/CyclomaticComplexity
85
+ # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength
60
86
  def help_command(args)
61
87
  topic = args[0]
62
88
 
63
89
  case topic
90
+ when 'help'
91
+ show_help_about_help
64
92
  when 'brands'
65
93
  show_brands_help
66
94
  when 'workflows'
@@ -80,11 +108,24 @@ class VatCLI
80
108
  puts "⚠️ '#{topic}' is deprecated. Use the new command name instead:\n\n"
81
109
  new_name = topic == 's3-cleanup' ? 's3-cleanup-remote' : 's3-cleanup-local'
82
110
  show_s3_help(new_name)
83
- else
111
+ when nil
84
112
  show_main_help
113
+ else
114
+ puts "❌ Unknown help topic: #{topic}"
115
+ puts ''
116
+ puts 'Available help topics:'
117
+ puts ' dam help brands # Brand shortcuts and configuration'
118
+ puts ' dam help workflows # FliVideo and Storyline workflows'
119
+ puts ' dam help config # Configuration setup'
120
+ puts ' dam help list # List command usage'
121
+ puts ' dam help s3-up # S3 upload command'
122
+ puts ' dam help s3-down # S3 download command'
123
+ puts ' dam help s3-status # S3 status command'
124
+ puts ''
125
+ puts "Run 'dam help' for general help."
85
126
  end
86
127
  end
87
- # rubocop:enable Metrics/CyclomaticComplexity
128
+ # rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength
88
129
 
89
130
  # List brands and projects
90
131
  def list_command(args)
@@ -729,6 +770,39 @@ class VatCLI
729
770
  HELP
730
771
  end
731
772
 
773
+ def show_help_about_help
774
+ puts <<~HELP
775
+ DAM Help System
776
+
777
+ The DAM CLI provides contextual help for all commands and concepts.
778
+
779
+ Usage:
780
+ dam help Show general help (all commands)
781
+ dam help <topic> Show help for specific topic
782
+
783
+ Available Help Topics:
784
+ brands Brand shortcuts and naming (appydave, voz, aitldr, etc.)
785
+ workflows FliVideo vs Storyline workflows explained
786
+ config Configuration file setup and paths
787
+ list List command usage and pattern matching
788
+ s3-up S3 upload command details
789
+ s3-down S3 download command details
790
+ s3-status S3 sync status command details
791
+
792
+ Tips:
793
+ - Most commands support --dry-run to preview actions
794
+ - Brand shortcuts are case-insensitive (ad, AD, Ad all work)
795
+ - Use patterns like 'b6*' to match multiple projects
796
+ - Run 'dam --version' to check your installed version
797
+
798
+ Examples:
799
+ dam help brands # Learn about brand configuration
800
+ dam help workflows # Understand video workflows
801
+ dam help config # Setup configuration files
802
+ dam help s3-up # S3 upload command help
803
+ HELP
804
+ end
805
+
732
806
  def show_brands_help
733
807
  puts <<~HELP
734
808
  Available Brands
@@ -150,7 +150,7 @@ module Appydave
150
150
 
151
151
  # Find the most recent modification time across all projects
152
152
  def self.find_last_modified(brand, projects)
153
- return Time.at(0) if projects.empty?
153
+ return nil if projects.empty?
154
154
 
155
155
  projects.map do |project|
156
156
  File.mtime(Config.project_path(brand, project))
@@ -271,10 +271,21 @@ module Appydave
271
271
 
272
272
  if s3_files.empty? && local_files.empty?
273
273
  puts "❌ No files found in S3 or locally for #{brand}/#{project_id}"
274
+ puts ' This project has no heavy files in s3-staging/ or S3.'
275
+ puts " Tip: Add files to #{File.basename(staging_dir)}/ folder, then run: dam s3-up"
274
276
  return
275
277
  end
276
278
 
277
279
  puts "📊 S3 Sync Status for #{brand}/#{project_id}"
280
+
281
+ # Show last sync time
282
+ if s3_files.any?
283
+ most_recent = s3_files.map { |f| f['LastModified'] }.compact.max
284
+ if most_recent
285
+ time_ago = format_time_ago(Time.now - most_recent)
286
+ puts " Last synced: #{time_ago} ago (#{most_recent.strftime('%Y-%m-%d %H:%M')})"
287
+ end
288
+ end
278
289
  puts ''
279
290
 
280
291
  # Combine all file paths (S3 + local)
@@ -563,6 +574,28 @@ module Appydave
563
574
  end
564
575
  end
565
576
 
577
+ def format_time_ago(seconds)
578
+ return 'just now' if seconds < 60
579
+
580
+ minutes = seconds / 60
581
+ return "#{minutes.round} minute#{'s' if minutes > 1}" if minutes < 60
582
+
583
+ hours = minutes / 60
584
+ return "#{hours.round} hour#{'s' if hours > 1}" if hours < 24
585
+
586
+ days = hours / 24
587
+ return "#{days.round} day#{'s' if days > 1}" if days < 7
588
+
589
+ weeks = days / 7
590
+ return "#{weeks.round} week#{'s' if weeks > 1}" if weeks < 4
591
+
592
+ months = days / 30
593
+ return "#{months.round} month#{'s' if months > 1}" if months < 12
594
+
595
+ years = days / 365
596
+ "#{years.round} year#{'s' if years > 1}"
597
+ end
598
+
566
599
  def detect_content_type(filename)
567
600
  ext = File.extname(filename).downcase
568
601
  case ext
@@ -60,15 +60,6 @@ module Appydave
60
60
  puts "📊 Brand Status: v-#{brand}"
61
61
  puts ''
62
62
 
63
- # Show git remote (with self-healing)
64
- remote = Config.git_remote(brand)
65
- if remote
66
- puts "📡 Git Remote: #{remote}"
67
- else
68
- puts '📡 Git Remote: Not configured (not a git repository)'
69
- end
70
- puts ''
71
-
72
63
  # Show git status
73
64
  if git_repo?
74
65
  show_brand_git_status
@@ -108,7 +99,7 @@ module Appydave
108
99
  local = project_entry[:storage][:local]
109
100
 
110
101
  if local[:exists]
111
- puts " 📁 Local: ✓ exists (#{local[:structure]} structure)"
102
+ puts ' 📁 Local: ✓ exists'
112
103
  puts " Heavy files: #{local[:has_heavy_files] ? 'yes' : 'no'}"
113
104
  puts " Light files: #{local[:has_light_files] ? 'yes' : 'no'}"
114
105
  else
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Appydave
4
4
  module Tools
5
- VERSION = '0.40.0'
5
+ VERSION = '0.42.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.40.0",
3
+ "version": "0.42.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.40.0
4
+ version: 0.42.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Cruwys