Skip to content

Commit 1cb09eb

Browse files
Added support for busybox sh
1 parent a07859b commit 1cb09eb

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

identify/identify.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,8 @@ def parse_shebang(bytesio: IO[bytes]) -> tuple[str, ...]:
195195
cmd = cmd[2:]
196196
elif cmd[:1] == ('/usr/bin/env',):
197197
cmd = cmd[1:]
198+
elif cmd[:1] == ('/bin/busybox',):
199+
cmd = cmd[1:]
198200

199201
if cmd == ('nix-shell',):
200202
return _parse_nix_shebang(bytesio, cmd)

tests/identify_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ def test_file_is_text_does_not_exist(tmpdir):
261261
(b'#!/usr/bin/env python', ('python',)),
262262
(b'#! /usr/bin/python', ('/usr/bin/python',)),
263263
(b'#!/usr/bin/foo python', ('/usr/bin/foo', 'python')),
264+
(b'#!/bin/busybox sh', ()),
264265
# despite this being invalid, setuptools will write shebangs like this
265266
(b'#!"/path/with spaces/x" y', ('/path/with spaces/x', 'y')),
266267
# this is apparently completely ok to embed quotes

0 commit comments

Comments
 (0)