-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Viktor Dick
committed
Feb 26, 2024
1 parent
2fd37e8
commit dc6253d
Showing
3 changed files
with
63 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env python | ||
|
||
from ..subcommand import SubCommand | ||
from ..helpers import hashdir | ||
|
||
|
||
class LayerHash(SubCommand): | ||
"""Compute hashes for the contents of a layer""" | ||
subcommand = 'layer-hash' | ||
connect = False | ||
use_config = False | ||
|
||
@staticmethod | ||
def add_args(parser): | ||
parser.add_argument( | ||
'path', type=str, help="Root folder of layer" | ||
) | ||
|
||
def run(self): | ||
for path, checksum in hashdir(self.args.path.rstrip('/')): | ||
print(checksum, path) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters