diff options
| author | mo khan <mo@mokhan.ca> | 2025-12-11 15:07:28 -0700 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-12-11 15:07:28 -0700 |
| commit | 88617d035ad5828e430d4546430f7d855a5c0a24 (patch) | |
| tree | 8ed38439f3f6d437db762cf732e4526e0ad8a152 /exe | |
| parent | ecc324eb9fd20c6b48d65cb279e0afad6e5d886e (diff) | |
feat: export JSON files from the git repo
Diffstat (limited to 'exe')
| -rwxr-xr-x | exe/gitem | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -1,3 +1,21 @@ #!/usr/bin/env ruby +# frozen_string_literal: true require "gitem" + +if ARGV.empty? + puts "Usage: ruby #{$0} <path-to-git-repo> [output-directory]" + puts "Default output: <repo>/.git/srv/" + puts "Example: ruby #{$0} ." + exit 1 +end + +repo_path = ARGV[0] +output_dir = ARGV[1] + +unless File.exist?(File.join(repo_path, '.git')) || File.exist?(File.join(repo_path, 'HEAD')) + puts "Error: #{repo_path} is not a valid git repository" + exit 1 +end + +Gitem::GitToJson.new(repo_path, output_dir).export! |
