Skip to content

Commit 430c60b

Browse files
SuperMaxusacopy
authored andcommitted
fix opening folder in fs2json and copy-to-sha256 on Windows, small fix in fs2json help message
1 parent 8561f1a commit 430c60b

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

tools/copy-to-sha256.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ def main():
3535
from_path = os.path.normpath(args.from_path)
3636
to_path = os.path.normpath(args.to_path)
3737

38-
try:
38+
if os.path.isfile(from_path):
3939
tar = tarfile.open(from_path, "r")
40-
except IsADirectoryError:
40+
else:
4141
tar = None
4242

4343
if tar:

tools/fs2json.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def main():
5252
logger.setLevel(logging.DEBUG)
5353

5454
args = argparse.ArgumentParser(description="Create filesystem JSON. Example:\n"
55-
" ./fs2xml.py --exclude /boot/ --out fs.json /mnt/",
55+
" ./fs2json.py --exclude /boot/ --out fs.json /mnt/",
5656
formatter_class=argparse.RawTextHelpFormatter
5757
)
5858
args.add_argument("--exclude",
@@ -73,9 +73,9 @@ def main():
7373

7474
path = os.path.normpath(args.path)
7575

76-
try:
76+
if os.path.isfile(path):
7777
tar = tarfile.open(path, "r")
78-
except IsADirectoryError:
78+
else:
7979
tar = None
8080

8181
if tar:

0 commit comments

Comments
 (0)