Spring-hateoas: Migration script fails with "unterminated substitute pattern"

Created on 18 Oct 2019  路  8Comments  路  Source: spring-projects/spring-hateoas

The migration script to version 1.0 (https://github.com/spring-projects/spring-hateoas/blob/master/etc/migrate-to-1.0.sh) fails when I run it on my macOS machine (Mojave 10.14.6) with the error message sed: 1: "s/Link\.REL_SELF/IanaLi ...": unterminated substitute pattern repeated for each file matching the pattern.

Most helpful comment

On linux it failed too with sed: can't read : No such file or directory.
I had to change the sed command to sed -i -e "$EXPRESSION" $FILE

All 8 comments

Same for me on macOS 10.14.5.

I'll let @odrotbohm deal with sed errors.

On linux it failed too with sed: can't read : No such file or directory.
I had to change the sed command to sed -i -e "$EXPRESSION" $FILE

Thanks @mgaceanu for your valuable advice! It saved me a lot of time!

I had the same problem on MacOS. Seems that the EXPRESSION string is too long for Mac-sed. If I run the script with the second half of the EXPRESSION commented out (make sure you terminate the EXPRESSION properly) it runs without problem. Then repeat with only the first half of EXPRESSION commented out.

My application still needs a lot of manual changes after running the script though...

Hey, any update on this?

I also ran into same issue on mac. thanks to cdlans for figuring out the problem. I modified the script and split the expression into EXPRESSION1 AND EXPRESSION2 each with 32 lines. and then give -e "$EXPRESSON1" -e"$EXPRESSION2" to the sed

I managed to do it in a docker container with @mgaceanu suggestion and it worked.

$ docker run --rm -it -v (pwd):/tmp/my-repo ubuntu:21.04
$ cd tmp/my-repo
$ ./migrate-to-1.0.sh

Worked like a charm :)

Was this page helpful?
0 / 5 - 0 ratings