fix: ship updatable 1.1.1 source archives
Package a clean shallow main checkout with credential-free Gitea remote, localize the China launcher, and set the new-install Responses endpoint.
This commit is contained in:
1 parent
bfcd828fa8
commit
8522fa3ca3
22 files changed
+445
-140
No files matched your search
@@ -12,7 +12,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
"""Keep bootstrap scripts ASCII for Windows PowerShell 5.1 compatibility.
|
||||
"""Require ASCII or UTF-8 with BOM for Windows PowerShell 5.1 scripts.
|
||||
|
||||
BOM-less scripts are decoded using the system ANSI code page. UTF-8 symbols
|
||||
can become quote delimiters under cp1252 and cause parse errors.
|
||||
@@ -31,18 +31,11 @@ def test_powershell_scripts_are_discovered():
|
||||
|
||||
|
||||
@pytest.mark.parametrize("script", POWERSHELL_SCRIPTS, ids=lambda p: p.name)
|
||||
def test_powershell_script_is_pure_ascii(script):
|
||||
def test_powershell_script_has_windows_compatible_encoding(script):
|
||||
raw = script.read_bytes()
|
||||
offending = []
|
||||
line_no = 1
|
||||
for index, byte in enumerate(raw):
|
||||
if byte == 0x0A:
|
||||
line_no += 1
|
||||
elif byte > 0x7F:
|
||||
offending.append((line_no, index, hex(byte)))
|
||||
|
||||
assert not offending, (
|
||||
f"{script.name} contains non-ASCII bytes at (line, offset, byte) "
|
||||
f"{offending[:10]}; Windows PowerShell 5.1 decodes BOM-less .ps1 files "
|
||||
"with the system ANSI code page. Use ASCII status labels."
|
||||
)
|
||||
if any(byte > 0x7F for byte in raw):
|
||||
assert raw.startswith(b"\xef\xbb\xbf"), (
|
||||
f"{script.name} contains non-ASCII bytes without a UTF-8 BOM; "
|
||||
"Windows PowerShell 5.1 would use the system ANSI code page."
|
||||
)
|
||||
raw.decode("utf-8-sig")
|
||||
Reference in new issue
Block a user