Skip to content

Error running setup.sh name on MacOS #8

Description

@yepher

Issue Overview

Running setup.sh name fails with this error on MacOS:

sed: 1: "./setup.sh": invalid command code .

See video here (5:03)

Describe your environment

Running on MacOS M2

Steps to Reproduce

  1. cd gitops-foundations-env-2892009
  2. chmod +x setup.sh
  3. ./setup.sh name

Expected Behavior

Should change all the files that contains {dockerHubUsername} to name

Current Behavior

Fails with this error:

sed: 1: "./setup.sh": invalid command code .

Possible Solution

Changing the script to this:

#!/bin/bash

if [ $# -eq 0 ]; then
  echo "Please provide a value for {dockerHubUsername}"
  exit 1
fi

find . -name '*.yaml' -type f -exec sed -i '' -E "s/{dockerHubUsername}/$1/g" {} +

Related Issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions