Skip to content

edit.sh needs to test edits using sed #7151

Closed

Description

@deads2k

But mac OS has an incompatible level of sed, so we can't write it in a way that works on CI and mac os.

Activity

  1. liggitt commented on Feb 9, 2016

    @liggitt
    Contributor

    If you write the tests, I'll make them work on osx or I'll stop whining (probably)

  2. php-coder commented on Feb 10, 2016

    @php-coder

    If it's possible to use Perl then we could try to use it: perl -pi -e 's/bar/baz/' file

  3. stevekuznetsov commented on Apr 8, 2017

    @stevekuznetsov
    Contributor

    It's using sed now:

    editorfile="$(mktemp -d)/tmp-editor.sh"
    echo '#!/bin/bash' > ${editorfile}
    echo 'sed -i "s/^tag: null/tag:\n  referencePolicy:\n    type: Source/g" $1' >> ${editorfile}
    echo 'sed -i "s/^metadata:$/metadata:\n  annotations:\n    tags: hidden/g" $1' >> ${editorfile}
    chmod +x ${editorfile}
    os::cmd::expect_success "EDITOR=${editorfile} oc edit istag/test:new"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions