legionio 1.6.38 → 1.6.39
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 +4 -4
- data/CHANGELOG.md +9 -0
- data/lib/legion/cli/bootstrap_command.rb +30 -8
- data/lib/legion/cli/config_command.rb +37 -0
- data/lib/legion/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5142569b9415c49d014ad0c27669e3f2b250a2724fcf860afebc056eef5ecf45
|
|
4
|
+
data.tar.gz: 4b2fd70307b2583923c14ec037a864199d82a61cd157aff508b51fb09057b18d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5d00fdd0a88a65fe50904c7e04765e148c22d8db5e04a7efcc7591d0ca00b590035f1e8d4ad64c9b155d5a1b8dc6e422f4bf587658c32addb6bde98297e2384e
|
|
7
|
+
data.tar.gz: 2055fb022fd9d43689b1d88fc78e3ef1ce5b1c050563a196f5c42eb1144828a6663715ae9aa729e9f793e2ffa5fdfebfa1015d0bf346fb07f6d2f054b672f6d7
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [1.6.39] - 2026-03-30
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- `legionio config reset` subcommand to wipe all JSON config files from settings directory (#88)
|
|
9
|
+
- `legionio bootstrap --clean` flag to clear settings before import (#88)
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
- `legionio bootstrap` no longer runs `ConfigScaffold` when a source is provided — scaffolded empty files were conflicting with imported config (#88)
|
|
13
|
+
|
|
5
14
|
## [1.6.38] - 2026-03-30
|
|
6
15
|
|
|
7
16
|
### Removed
|
|
@@ -21,6 +21,7 @@ module Legion
|
|
|
21
21
|
class_option :skip_packs, type: :boolean, default: false, desc: 'Skip gem pack installation (config only)'
|
|
22
22
|
class_option :start, type: :boolean, default: false, desc: 'Start redis + legionio via brew services after bootstrap'
|
|
23
23
|
class_option :force, type: :boolean, default: false, desc: 'Overwrite existing config files'
|
|
24
|
+
class_option :clean, type: :boolean, default: false, desc: 'Remove all existing config files before import'
|
|
24
25
|
|
|
25
26
|
desc 'SOURCE', 'Bootstrap Legion from a URL or local config file (fetch config, scaffold, install packs)'
|
|
26
27
|
long_desc <<~DESC
|
|
@@ -53,16 +54,19 @@ module Legion
|
|
|
53
54
|
print_step(out, 'Pre-flight checks')
|
|
54
55
|
results[:preflight] = run_preflight_checks(out, warns)
|
|
55
56
|
|
|
56
|
-
# 2.
|
|
57
|
+
# 2. Clean existing config (--clean)
|
|
58
|
+
results[:cleaned] = clean_settings(out) if options[:clean]
|
|
59
|
+
|
|
60
|
+
# 3. Fetch + parse config
|
|
57
61
|
print_step(out, "Fetching config from #{source}")
|
|
58
62
|
body = ConfigImport.fetch_source(source)
|
|
59
63
|
config = ConfigImport.parse_payload(body)
|
|
60
64
|
|
|
61
|
-
#
|
|
65
|
+
# 4. Extract packs before writing (bootstrap-only directive)
|
|
62
66
|
pack_names = Array(config.delete(:packs)).map(&:to_s).reject(&:empty?)
|
|
63
67
|
results[:packs_requested] = pack_names
|
|
64
68
|
|
|
65
|
-
#
|
|
69
|
+
# 5. Write config
|
|
66
70
|
paths = ConfigImport.write_config(config, force: options[:force])
|
|
67
71
|
results[:config_written] = paths
|
|
68
72
|
unless options[:json]
|
|
@@ -73,18 +77,18 @@ module Legion
|
|
|
73
77
|
end
|
|
74
78
|
end
|
|
75
79
|
|
|
76
|
-
#
|
|
77
|
-
results[:scaffold] =
|
|
80
|
+
# 6. Scaffold missing subsystem files (skipped when source provided)
|
|
81
|
+
results[:scaffold] = :skipped
|
|
78
82
|
|
|
79
|
-
#
|
|
83
|
+
# 7. Install packs (unless --skip-packs)
|
|
80
84
|
results[:packs_installed] = install_packs_step(pack_names, out)
|
|
81
85
|
|
|
82
|
-
#
|
|
86
|
+
# 8. Post-bootstrap summary
|
|
83
87
|
summary = build_summary(config, results, warns)
|
|
84
88
|
results[:summary] = summary
|
|
85
89
|
print_summary(out, summary)
|
|
86
90
|
|
|
87
|
-
#
|
|
91
|
+
# 9. Optional --start
|
|
88
92
|
if options[:start]
|
|
89
93
|
print_step(out, 'Starting services')
|
|
90
94
|
results[:services_started] = start_services(out)
|
|
@@ -207,6 +211,24 @@ module Legion
|
|
|
207
211
|
end
|
|
208
212
|
end
|
|
209
213
|
|
|
214
|
+
# -----------------------------------------------------------------------
|
|
215
|
+
# Clean settings (--clean)
|
|
216
|
+
# -----------------------------------------------------------------------
|
|
217
|
+
|
|
218
|
+
def clean_settings(out)
|
|
219
|
+
dir = ConfigImport::SETTINGS_DIR
|
|
220
|
+
files = Dir.glob(File.join(dir, '*.json'))
|
|
221
|
+
if files.empty?
|
|
222
|
+
out.warn("No existing config files to clean in #{dir}") unless options[:json]
|
|
223
|
+
return []
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
print_step(out, "Cleaning #{files.size} config file(s) from #{dir}")
|
|
227
|
+
files.each { |f| FileUtils.rm_f(f) }
|
|
228
|
+
files.each { |f| out.success("Removed: #{File.basename(f)}") } unless options[:json]
|
|
229
|
+
files
|
|
230
|
+
end
|
|
231
|
+
|
|
210
232
|
# -----------------------------------------------------------------------
|
|
211
233
|
# Scaffold options
|
|
212
234
|
# -----------------------------------------------------------------------
|
|
@@ -184,6 +184,43 @@ module Legion
|
|
|
184
184
|
raise SystemExit, exit_code if exit_code != 0
|
|
185
185
|
end
|
|
186
186
|
|
|
187
|
+
desc 'reset', 'Remove all JSON config files from the settings directory'
|
|
188
|
+
long_desc <<~DESC
|
|
189
|
+
Removes all *.json files from the settings directory (~/.legionio/settings/).
|
|
190
|
+
Prompts for confirmation unless --force is passed.
|
|
191
|
+
DESC
|
|
192
|
+
option :force, type: :boolean, default: false, desc: 'Skip confirmation prompt'
|
|
193
|
+
def reset
|
|
194
|
+
require_relative 'config_import'
|
|
195
|
+
out = formatter
|
|
196
|
+
dir = options[:config_dir] || ConfigImport::SETTINGS_DIR
|
|
197
|
+
|
|
198
|
+
files = Dir.glob(File.join(dir, '*.json'))
|
|
199
|
+
if files.empty?
|
|
200
|
+
out.warn("No JSON files found in #{dir}")
|
|
201
|
+
return
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
unless options[:force]
|
|
205
|
+
out.warn("This will remove #{files.size} JSON file(s) from #{dir}:")
|
|
206
|
+
files.each { |f| puts " #{File.basename(f)}" }
|
|
207
|
+
print ' Continue? [y/N] '
|
|
208
|
+
answer = $stdin.gets&.strip
|
|
209
|
+
unless answer&.match?(/\Ay(es)?\z/i)
|
|
210
|
+
out.warn('Aborted.')
|
|
211
|
+
return
|
|
212
|
+
end
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
files.each { |f| FileUtils.rm_f(f) }
|
|
216
|
+
|
|
217
|
+
if options[:json]
|
|
218
|
+
out.json(removed: files, directory: dir)
|
|
219
|
+
else
|
|
220
|
+
out.success("Removed #{files.size} JSON file(s) from #{dir}")
|
|
221
|
+
end
|
|
222
|
+
end
|
|
223
|
+
|
|
187
224
|
desc 'import SOURCE', 'Import configuration from a URL or local file'
|
|
188
225
|
option :force, type: :boolean, default: false, desc: 'Overwrite existing imported config'
|
|
189
226
|
def import(source)
|
data/lib/legion/version.rb
CHANGED