mirror of
https://github.com/nvbn/thefuck.git
synced 2025-01-18 12:06:04 +00:00
fe1942866b
* Resolve paths before checking app identity Commands entered with a path do not match is_app. I encountered this when working with a test for the rm_dir rule. This rule did not use the @for_app decorator, but when I migrated it, the test for "./bin/hdfs.." failed because 'hdfs' was recognized as a command, while "./bin/hdfs" was not. This commit addresses the false negative by resolving path names in the command, via os.path.basename. * Remove paths from for_app invocations in rules I presume that the `./` in `./gradlew` was used here because thefuck would not find an app match on just `gradlew`, and thus no fucks would be given on the most common and idiomatic way of invoking gradlew. After 8faf9b1, thefuck does not distinguish between commands with paths and those without. Therefore, the tests for this rule are now broken because thefuck strips paths from the _user_'s command, but not from the for_app decoration. This commit addresses that problem by changing the for_app decoration to this rule.