snagflash: Fastboot cmd file now supports "paths-relative-to" env variable#92
Conversation
|
Hi Bastien, thanks for the contrib :). I don't think this is the right way to solve this, since it breaks backwards compatibility. I'll see if I can add a parameter to enable config-file-relative paths, like what was done for snagrecover config files. |
30f1ff8 to
75576b4
Compare
rgantois
left a comment
There was a problem hiding this comment.
Other than the two changes requested below, looks great!
|
|
||
| self.checked = True | ||
|
|
||
| def _resolve_path(self, path: str) -> str: |
There was a problem hiding this comment.
Please remove "_" prefix to follow naming conventions in this file
| self.checked = True | ||
|
|
||
| def _resolve_path(self, path: str) -> str: | ||
| if not os.path.isabs(path): |
There was a problem hiding this comment.
Please change to if os.path.isabs(path): return to save an indent
76e7964 to
12e0765
Compare
|
Looks like the linter is complaining, please run |
Path resolution can be controlled through the "paths-relative-to" environement variable, which can be configured using the existing "set" command. Supported values: - CWD (default): resolve paths relative to the current working directory. - THIS_FILE: resolve paths relative to the command file's directory. Any other value raises an error. The "paths-relative-to" environment variable is documented in the help text, as well as in docs/snagflash.md Add unittests for testing this feature (tests/fastboot_uboot.py), most notably for testing the SnagflashFastbootUboot.resolve_path() method. Note: The snagrecover config file already implements this feature, with the same variable name. Signed-off-by: Christophe Guerreiro <christophe.guerreiro@non.se.com> Signed-off-by: Bastien Sagetat <sagetat.bastien@non.se.com>
12e0765 to
1d768b6
Compare
|
Nice, thanks! |
Path resolution can be controlled through the "paths-relative-to" environement variable, which can be configured using the existing "set" command.
Supported values:
Any other value raises an error.
The "paths-relative-to" environment variable is documented in the help text, as well as in docs/snagflash.md
Add unittests for testing this feature (tests/fastboot_uboot.py), most notably for testing the SnagflashFastbootUboot.resolve_path() method.
Note:
The snagrecover config file already implements this feature, with the same variable name.
Changes