mirror of
https://github.com/facebook/sapling.git
synced 2024-10-05 06:18:07 +03:00
sshpeer: update bash script detection
Summary: Now `#!/usr/bin/env bash` is used for bash scripts (by D47269779) we need to update the bash detection for test compatibility. Reviewed By: evangrayk Differential Revision: D47457479 fbshipit-source-id: c6a449f53fb265f8a01d6368fe807e0b8bae03aa
This commit is contained in:
parent
200ff484a7
commit
ec426ff2fe
@ -353,8 +353,12 @@ def _popen4testhgserve(path, env=None, newlines: bool = False, bufsize: int = -1
|
||||
return True
|
||||
|
||||
with open(file, "rb") as file:
|
||||
start = file.read(12)
|
||||
return (b"#!/bin/bash" in start) or (b"#!/bin/sh" in start)
|
||||
start = file.read(32)
|
||||
return (
|
||||
(b"#!/bin/bash" in start)
|
||||
or (b"#!/bin/sh" in start)
|
||||
or b"env bash" in start
|
||||
)
|
||||
return False
|
||||
|
||||
# Append "defpath" (ex. /bin) to PATH. Needed for buck test (the main hg
|
||||
|
Loading…
Reference in New Issue
Block a user