Skip to content

Commit

Permalink
misc: bilingual shebang for Python executable scripts.
Browse files Browse the repository at this point in the history
  • Loading branch information
skosukhin committed Jan 9, 2024
1 parent d171918 commit d7046f7
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 3 deletions.
12 changes: 11 additions & 1 deletion mkhelper/depgen.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
#!/usr/bin/env python
#!/bin/sh
""":"
for cmd in python3 python; do
if command -v > /dev/null "${cmd}"; then
exec "${cmd}" "$0" "$@"
fi
done
echo "Error: could not find a python interpreter!" >&2
exit 1
":"""

import argparse
import os
import sys
Expand Down
12 changes: 11 additions & 1 deletion mkhelper/deplist.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
#!/usr/bin/env python
#!/bin/sh
""":"
for cmd in python3 python; do
if command -v > /dev/null "${cmd}"; then
exec "${cmd}" "$0" "$@"
fi
done
echo "Error: could not find a python interpreter!" >&2
exit 1
":"""

import argparse
import collections
import fnmatch
Expand Down
12 changes: 11 additions & 1 deletion mkhelper/fortmodcmp.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
#!/usr/bin/env python
#!/bin/sh
""":"
for cmd in python3 python; do
if command -v > /dev/null "${cmd}"; then
exec "${cmd}" "$0" "$@"
fi
done
echo "Error: could not find a python interpreter!" >&2
exit 1
":"""

import sys

BUF_MAX_SIZE = 512
Expand Down

0 comments on commit d7046f7

Please sign in to comment.