Skip to content

Commit efe040a

Browse files
fix: quote CLAUDE_PLUGIN_ROOT in hook commands to support paths with spaces (awslabs#212)
The aws-serverless and deploy-on-aws hooks passed ${CLAUDE_PLUGIN_ROOT} directly to /bin/sh -c without quoting or a bash prefix. When CLAUDE_CONFIG_DIR contains a space (e.g. /Users/me/Work/Company Name/), the shell word-splits the path and the hook fails on every Edit/Write with: /bin/sh: /Users/me/Work/Company: is a directory Wrap the interpolated path in escaped double quotes and prefix with bash, matching the pattern used by superpowers in anthropics/claude-plugins-official. Applied the same pattern to the databases-on-aws scripts README example so users don't copy the broken form. Closes awslabs#146 Co-authored-by: Scott Schreckengaust <scottschreckengaust@users.noreply.github.com>
1 parent 56429e4 commit efe040a

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

plugins/aws-serverless/hooks/hooks.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"hooks": [
77
{
88
"type": "command",
9-
"command": "${CLAUDE_PLUGIN_ROOT}/scripts/validate-template.sh",
9+
"command": "bash \"${CLAUDE_PLUGIN_ROOT}/scripts/validate-template.sh\"",
1010
"timeout": 120
1111
}
1212
]

plugins/databases-on-aws/scripts/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Add additional hooks to `.claude/settings.json` or override the defaults:
4747
"hooks": [
4848
{
4949
"type": "command",
50-
"command": "${CLAUDE_PLUGIN_ROOT}/scripts/cluster-info.sh $CLUSTER --region $REGION 2>/dev/null || true"
50+
"command": "bash \"${CLAUDE_PLUGIN_ROOT}/scripts/cluster-info.sh\" \"$CLUSTER\" --region \"$REGION\" 2>/dev/null || true"
5151
}
5252
]
5353
}

plugins/deploy-on-aws/hooks/hooks.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"hooks": [
77
{
88
"type": "command",
9-
"command": "${CLAUDE_PLUGIN_ROOT}/scripts/validate-drawio.sh",
9+
"command": "bash \"${CLAUDE_PLUGIN_ROOT}/scripts/validate-drawio.sh\"",
1010
"timeout": 30
1111
}
1212
]

0 commit comments

Comments
 (0)