2026-01-14 02:00:23 +00:00
|
|
|
#!/usr/bin/env nu
|
|
|
|
|
let tempdir = (mktemp --directory)
|
|
|
|
|
let template = $env.PWD
|
2025-10-07 10:32:04 +01:00
|
|
|
|
2026-01-14 02:00:23 +00:00
|
|
|
for command_is_simple in [Yes, No] {
|
|
|
|
|
for multi_command in [Yes, No] {
|
|
|
|
|
print ($"Testing with command_is_simple=($command_is_simple), " ++
|
|
|
|
|
$"multi_command=($multi_command)")
|
|
|
|
|
try {
|
|
|
|
|
do --capture-errors {
|
|
|
|
|
cd $tempdir
|
|
|
|
|
(
|
|
|
|
|
^cargo generate
|
|
|
|
|
--path $template
|
|
|
|
|
--force
|
|
|
|
|
--silent
|
|
|
|
|
--name nu_plugin_test_plugin
|
|
|
|
|
--define command_name="test command"
|
|
|
|
|
--define $"command_is_simple=($command_is_simple)"
|
|
|
|
|
--define $"multi_command=($multi_command)"
|
|
|
|
|
--define github_username=
|
|
|
|
|
)
|
|
|
|
|
do { cd nu_plugin_test_plugin; ^cargo test }
|
|
|
|
|
rm -r nu_plugin_test_plugin
|
|
|
|
|
}
|
|
|
|
|
} catch { |err|
|
|
|
|
|
print -e ($"Failed with command_is_simple=($command_is_simple), " ++
|
|
|
|
|
$"multi_command=($multi_command)")
|
|
|
|
|
rm -rf $tempdir
|
|
|
|
|
$err.raw
|
|
|
|
|
}
|
|
|
|
|
}
|
chore: complete KCL to Nickel migration cleanup and setup pre-commit
Clean up 404 KCL references (99.75% complete):
- Rename kcl_* variables to schema_*/nickel_* (kcl_path→schema_path, etc.)
- Update functions: parse_kcl_file→parse_nickel_file
- Update env vars: KCL_MOD_PATH→NICKEL_IMPORT_PATH
- Fix cli/providers-install: add has_nickel and nickel_version variables
- Correct import syntax: .nickel.→.ncl.
- Update 57 files across core, CLI, config, and utilities
Configure pre-commit hooks:
- Activate: nushell-check, nickel-typecheck, markdownlint
- Comment out: Rust hooks (fmt, clippy, test), check-yaml
Testing:
- Module discovery: 9 modules (6 providers, 1 taskserv, 2 clusters) ✅
- Syntax validation: 15 core files ✅
- Pre-commit hooks: all passing ✅
2026-01-08 20:08:46 +00:00
|
|
|
}
|
2026-01-14 02:00:23 +00:00
|
|
|
|
|
|
|
|
rm -rf $tempdir
|
|
|
|
|
print "All tests passed."
|