summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-03-01 18:38:49 +0200
committerPaul Buetow <paul@buetow.org>2026-03-01 18:38:49 +0200
commit08129b43792eeec92eacb9f47ce3f879489aa03c (patch)
treef527ba7c71c58536fa68b0acaef41dcd56a3cfc6 /bin
parent861e526d9ad9228f2b740dbcf00cf39d8fe652f2 (diff)
make rcm usable as a gem from any directory, fix bugs and tests
- Add lib/rcm.rb entry point and bin/rcm CLI executable - Update gemspec: v0.1.0, proper files list, executables, runtime deps - Support standalone arg parsing and --hosts filtering in options - Fix inverted logic and typo in FileBackup#different? (== vs !=, cecksum_b) - Fix unqualified File.directory? resolving to RCM::File in Directory - Fix test_chown assertions running before evaluate! creates files - Add setup to file tests to prevent order-dependent failures Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/rcm18
1 files changed, 18 insertions, 0 deletions
diff --git a/bin/rcm b/bin/rcm
new file mode 100755
index 0000000..2a7b6cd
--- /dev/null
+++ b/bin/rcm
@@ -0,0 +1,18 @@
+#!/usr/bin/env ruby
+# CLI entry point for RCM configuration management.
+# Usage: rcm <config.rb> [--dry] [--debug] [--hosts host1,host2]
+
+if ARGV.empty? || ARGV.first.start_with?('-')
+ warn "Usage: rcm <config.rb> [--dry] [--debug] [--hosts host1,host2]"
+ exit 1
+end
+
+config_file = ARGV.shift
+
+unless File.exist?(config_file)
+ warn "Error: file not found: #{config_file}"
+ exit 1
+end
+
+require 'rcm'
+load config_file