Skip to content

Commit 7cf5c45

Browse files
tpwrulesmarcan
authored andcommitted
asahi_fwextract: add console entrypoint
Allows scripts and users to simply run the command `asahi-fwextract` instead of invoking the module with Python directly. Signed-off-by: Thomas Watson <[email protected]>
1 parent 361f9e4 commit 7cf5c45

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

asahi_firmware/update.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def update_firmware(source, dest):
3535

3636
pkg.save_manifest(os.path.join(dest, "manifest.txt"))
3737

38-
if __name__ == "__main__":
38+
def main():
3939
import argparse
4040
import logging
4141
logging.basicConfig()
@@ -49,3 +49,6 @@ def update_firmware(source, dest):
4949
args = parser.parse_args()
5050

5151
update_firmware(args.source, args.dest)
52+
53+
if __name__ == "__main__":
54+
main()

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@
99
author_email='[email protected]',
1010
url='https://github.com/AsahiLinux/asahi-installer/',
1111
packages=['asahi_firmware'],
12+
entry_points={"console_scripts": ["asahi-fwextract = asahi_firmware.update:main"]}
1213
)

0 commit comments

Comments
 (0)