dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.01k stars 4.67k forks source link

vcpkg-init.sh fail in /bin/sh #108224

Closed iskiselev closed 2 hours ago

iskiselev commented 2 hours ago

Description

vcpkg-init.sh fail in /bin/sh with: /bin/sh: 85: /tmp/vcpkg-init.sh: Syntax error: Bad function name. It started recently, most probably after rename function to vcpkg-shell. Is - restricted for function name in sh shell? If script is not intended to be run with just sh, should first line be updated?

Reproduction Steps

curl -L https://aka.ms/vcpkg-init.sh --output /tmp/vcpkg-init.sh \ && chmod a+x /tmp/vcpkg-init.sh \ && /bin/sh -c ". /tmp/vcpkg-init.sh" \

Expected behavior

Script runs without issues

Actual behavior

Script fails with /bin/sh: 85: /tmp/vcpkg-init.sh: Syntax error: Bad function name

Regression?

Yes, it worked on 2024-09-07, but was broken on 2024-09-14.

Known Workarounds

Run script using /bin/bash

Configuration

No response

Other information

No response

dotnet-policy-service[bot] commented 2 hours ago

Tagging subscribers to this area: @hoyosjs See info in area-owners.md if you want to be subscribed.

iskiselev commented 2 hours ago

Sorry, incorrect repo.