Skip to content

Commit ed35b86

Browse files
author
Kevin Paulisse
committed
Add --preserve-environments option
1 parent ae81183 commit ed35b86

2 files changed

Lines changed: 25 additions & 0 deletions

File tree

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# frozen_string_literal: true
2+
3+
# Preserve the `environments` directory from the repository when compiling the catalog. Likely
4+
# requires some combination of `--to-environment`, `--from-environment`, and/or `--create-symlinks`
5+
# to work correctly.
6+
# @param parser [OptionParser object] The OptionParser argument
7+
# @param options [Hash] Options hash being constructed; this is modified in this method.
8+
OctocatalogDiff::CatalogDiff::Cli::Options::Option.newoption(:preserve_environments) do
9+
has_weight 501
10+
11+
def parse(parser, options)
12+
parser.on('--[no-]preserve-environments', 'Enable or disable environment preservation') do |x|
13+
options[:preserve_environments] = x
14+
end
15+
end
16+
end
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# frozen_string_literal: true
2+
3+
require_relative '../options_helper'
4+
5+
describe OctocatalogDiff::CatalogDiff::Cli::Options do
6+
describe '#opt_preserve_environments' do
7+
include_examples 'true/false option', 'preserve-environments', :preserve_environments
8+
end
9+
end

0 commit comments

Comments
 (0)