From 45aa75701c842eede0cb1965c7bac8a7a2e625f6 Mon Sep 17 00:00:00 2001 From: Nara Kasbergen Kwon <855115+xiehan@users.noreply.github.com> Date: Wed, 10 Jan 2024 14:33:46 +0100 Subject: [PATCH 1/2] fix(go): improve docs for deprecated packages --- src/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 87211801..b0fd4e7a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -196,7 +196,8 @@ export class CdktfProviderProject extends cdk.JsiiProject { run: [ "sed -i 's/# CDKTF prebuilt bindings for/# CDKTF Go bindings for/' .repo/dist/go/*/README.md", // @see https://stackoverflow.com/a/49511949 - "sed -i -e '/## Available Packages/,/### Go/!b' -e '/### Go/!d;p; s/### Go/## Go Package/' -e 'd' .repo/dist/go/*/README.md", + // eslint-disable-next-line prettier/prettier + `sed -i -e '/## ${isDeprecated ? 'Deprecated' : 'Available'} Packages/,/### Go/!b' -e '/### Go/!d;p; s/### Go/## Go Package/' -e 'd' .repo/dist/go/*/README.md`, // sed -e is black magic and for whatever reason the string replace doesn't work so let's try it again: // eslint-disable-next-line prettier/prettier `sed -i 's/### Go/## ${isDeprecated ? 'Deprecated' : 'Go'} Package/' .repo/dist/go/*/README.md`, From 149915d44aa757f59752c766f33b5e9107eb20c2 Mon Sep 17 00:00:00 2001 From: team-tf-cdk Date: Wed, 10 Jan 2024 13:35:44 +0000 Subject: [PATCH 2/2] chore: self mutation Signed-off-by: team-tf-cdk --- test/__snapshots__/index.test.ts.snap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/__snapshots__/index.test.ts.snap b/test/__snapshots__/index.test.ts.snap index c63e6588..8f6f0fb4 100644 --- a/test/__snapshots__/index.test.ts.snap +++ b/test/__snapshots__/index.test.ts.snap @@ -811,7 +811,7 @@ jobs: - name: Remove some text from the README that doesn't apply to Go run: |- sed -i 's/# CDKTF prebuilt bindings for/# CDKTF Go bindings for/' .repo/dist/go/*/README.md - sed -i -e '/## Available Packages/,/### Go/!b' -e '/### Go/!d;p; s/### Go/## Go Package/' -e 'd' .repo/dist/go/*/README.md + sed -i -e '/## Deprecated Packages/,/### Go/!b' -e '/### Go/!d;p; s/### Go/## Go Package/' -e 'd' .repo/dist/go/*/README.md sed -i 's/### Go/## Deprecated Package/' .repo/dist/go/*/README.md sed -i -e '/API.typescript.md/,/You can also visit a hosted version/!b' -e 'd' .repo/dist/go/*/README.md sed -i 's|Find auto-generated docs for this provider here:|Find auto-generated docs for this provider [here](https://github.com/cdktf/cdktf-provider-random/blob/main/docs/API.go.md).|' .repo/dist/go/*/README.md