Skip to content

Commit 3a93231

Browse files
committed
cr
1 parent 22cf314 commit 3a93231

File tree

3 files changed

+38
-2
lines changed

3 files changed

+38
-2
lines changed

packages/@aws-cdk/mixins-preview/lib/custom-resource-handlers/aws-s3/auto-delete-objects-provider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export class AutoDeleteObjectsProvider extends CustomResourceProviderBase {
1818
private constructor(scope: Construct, id: string, props?: CustomResourceProviderOptions) {
1919
super(scope, id, {
2020
...props,
21-
codeDirectory: path.join(__dirname, 'auto-delete-objects-handler'),
21+
codeDirectory: path.join(__dirname, '..', 'dist', 'aws-s3', 'auto-delete-objects-handler'),
2222
runtimeName: determineLatestNodeRuntimeName(scope),
2323
});
2424
this.node.addMetadata('aws:cdk:is-custom-resource-handler-customResourceProvider', true);

packages/@aws-cdk/mixins-preview/package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
"devDependencies": {
8888
"@aws-cdk/cdk-build-tools": "0.0.0",
8989
"@aws-cdk/pkglint": "0.0.0",
90+
"@aws-cdk/custom-resource-handlers": "0.0.0",
9091
"@types/jest": "^29.5.14",
9192
"aws-cdk-lib": "0.0.0",
9293
"constructs": "^10.0.0",
@@ -106,7 +107,11 @@
106107
"awscdkio": {
107108
"announce": false
108109
},
109-
"cdk-build": {},
110+
"cdk-build": {
111+
"pre": [
112+
"./scripts/airlift-custom-resource-handlers.sh"
113+
]
114+
},
110115
"publishConfig": {
111116
"tag": "latest"
112117
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
3+
scriptdir=$(cd $(dirname $0) && pwd)
4+
targetdir=${scriptdir}/..
5+
customresourcedir=$(node -p "path.dirname(require.resolve('@aws-cdk/custom-resource-handlers/package.json'))")
6+
7+
function airlift() {
8+
mkdir -p $targetdir/lib/custom-resource-handlers/$1
9+
cp $customresourcedir/$2 $targetdir/lib/custom-resource-handlers/$1
10+
}
11+
12+
function recurse() {
13+
local dir=$1
14+
15+
for file in $dir/*; do
16+
if [ -f $file ]; then
17+
case $file in
18+
$customresourcedir/dist/aws-s3/*/index.js)
19+
cr=$(echo $file | rev | cut -d "/" -f 2-4 | rev)
20+
airlift $cr $cr/index.js
21+
;;
22+
esac
23+
fi
24+
25+
if [ -d $file ]; then
26+
recurse $file
27+
fi
28+
done
29+
}
30+
31+
recurse $customresourcedir/dist

0 commit comments

Comments
 (0)