Usage Information
fallout-migrate built from main (@ f072c9de), .NET SDK 10.0.203, macOS (Darwin / Unix). Reproducible on any Unix-like OS.
Description
The CLI's positional path argument is silently discarded whenever it starts with /, because the argument parser treats any /-prefixed token as an option (the Windows /?-switch convention). On macOS/Linux every absolute path starts with /, so fallout-migrate /abs/path/to/repo ignores the path entirely and falls back to ResolveRootDirectory(null). That walks up from the current working directory and migrates whatever NUKE repo the CWD happens to be under, in place, with no confirmation, printing a misleading Migration complete.
This is a data-safety issue: the tool can rewrite a repository the user never pointed it at.
Root cause (src/Fallout.Migrate/Program.cs):
var rootArg = Array.Find(args, a => !a.StartsWith('-') && !a.StartsWith('/'));
The !a.StartsWith('/') clause excludes all Unix absolute paths from being recognised as the root argument.
Reproduction Steps
- Have two NUKE consumer repos, e.g.
~/work/repoA (has build/, build.sh) and /tmp/repoB.
cd ~/work/repoA
- Run
fallout-migrate /tmp/repoB (intending to migrate repoB).
- Observe that the summary reports files under repoA, and that repoA (not
/tmp/repoB) was modified in place. git status in repoA shows the migration; repoB is untouched.
Expected Behavior
An absolute path argument is honoured as the repository root, especially on Unix, where absolute paths necessarily start with /. fallout-migrate /tmp/repoB migrates /tmp/repoB.
Actual Behavior
The absolute path is treated as an option and ignored; the tool migrates the CWD-derived root instead, in place, and reports success.
Regression?
Unknown. Present in current main.
Known Workarounds
cd into the target repo and run fallout-migrate with no path argument, or
- pass a relative path (which does not start with
/).
Suggested fix: restrict the option check to actual switches (/?, -h, etc.) rather than any /-prefixed token, and/or prefer Path.IsPathRooted(arg) && Directory.Exists(arg) when classifying the argument. A confirmation prompt before an in-place rewrite would also help.
Could you help with a pull-request?
Yes.
Usage Information
fallout-migratebuilt frommain(@f072c9de), .NET SDK 10.0.203, macOS (Darwin / Unix). Reproducible on any Unix-like OS.Description
The CLI's positional
pathargument is silently discarded whenever it starts with/, because the argument parser treats any/-prefixed token as an option (the Windows/?-switch convention). On macOS/Linux every absolute path starts with/, sofallout-migrate /abs/path/to/repoignores the path entirely and falls back toResolveRootDirectory(null). That walks up from the current working directory and migrates whatever NUKE repo the CWD happens to be under, in place, with no confirmation, printing a misleadingMigration complete.This is a data-safety issue: the tool can rewrite a repository the user never pointed it at.
Root cause (
src/Fallout.Migrate/Program.cs):The
!a.StartsWith('/')clause excludes all Unix absolute paths from being recognised as the root argument.Reproduction Steps
~/work/repoA(hasbuild/,build.sh) and/tmp/repoB.cd ~/work/repoAfallout-migrate /tmp/repoB(intending to migrate repoB)./tmp/repoB) was modified in place.git statusin repoA shows the migration; repoB is untouched.Expected Behavior
An absolute path argument is honoured as the repository root, especially on Unix, where absolute paths necessarily start with
/.fallout-migrate /tmp/repoBmigrates/tmp/repoB.Actual Behavior
The absolute path is treated as an option and ignored; the tool migrates the CWD-derived root instead, in place, and reports success.
Regression?
Unknown. Present in current
main.Known Workarounds
cdinto the target repo and runfallout-migratewith no path argument, or/).Suggested fix: restrict the option check to actual switches (
/?,-h, etc.) rather than any/-prefixed token, and/or preferPath.IsPathRooted(arg) && Directory.Exists(arg)when classifying the argument. A confirmation prompt before an in-place rewrite would also help.Could you help with a pull-request?
Yes.