Skip to content

Commit

Permalink
Add shebang to distro.py
Browse files Browse the repository at this point in the history
This allows executing the file as a standalone script.

Previously, without the shebang, trying to execute results in the
following:

    $ ./distro.py
    ./distro.py: line 28: platform.linux_distribution: command not found
    ./distro.py: line 28: platform.dist: command not found
    ./distro.py: line 28: Python: command not found
    ./distro.py: command substitution: line 29: syntax error near unexpected token `newline'
    ./distro.py: command substitution: line 29: `<https://bugs.python.org/issue1322>'
    ...

Now:

    $ ./distro.py
    Name: Fedora 34 (Workstation Edition)
    Version: 34
    Codename:
  • Loading branch information
jdufresne committed Nov 25, 2021
1 parent 568f601 commit 8032f16
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions distro.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env python
# Copyright 2015,2016,2017 Nir Cohen
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down

0 comments on commit 8032f16

Please sign in to comment.