-
Notifications
You must be signed in to change notification settings - Fork 54
Closed
Labels
good first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed
Description
The sed command is used in many of our helper scripts. However sed preinstalled on macOS is not POSIX compliant (works differently than on most Linux distributions). But testing for the OS on which the script is being run on is not a good proxy to find out which version of sed is going to be available since macOS users can easily reinstall it (Homebrew, symlink, ...). On top of that, some Bash emulators used on Windows do not present as an operating system.
We need to replace this test for specific operating systems (or specific Bash emulator):
With this more generic test:
if ! sed -i '1s/^/test/' $(mktemp) 2> /dev/null; then
# macOS (BSD) version of sed
alias gsed="sed -i ''"
else
# POSIX compliant version of sed
alias gsed="sed -i"
fised is used in various script in the mlx and katalog repo where the platform check needs to be replaced:
- in the
mlxrepo:- mlx/api/codegen.sh
- mlx/tools/bash/add_license_headers.sh
- in the
katalogrepo:- katalog/tools/bash/upgrade_notebook_requirements.sh
- katalog/tools/bash/add_license_headers.sh
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed