mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-03 07:18:03 +01:00
fix(skill-start): --render with any value but unattended is refused (GST-825 fix-check)
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
18c739eee1
commit
dfe8883f12
2 files changed
+6
-4
No files matched your search
@@ -41,14 +41,15 @@ SKILL_NAME=""
|
||||
MODEL_OVERLAY="none"
|
||||
PARENT_PID=""
|
||||
BRAIN_HEALTH="no"
|
||||
RENDER_KIND="none"
|
||||
RENDER_KIND=""
|
||||
RENDER_SET="no"
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
--skill) SKILL_NAME="$2"; shift 2 ;;
|
||||
--model) MODEL_OVERLAY="$2"; shift 2 ;;
|
||||
--parent-pid) PARENT_PID="$2"; shift 2 ;;
|
||||
--brain-health) BRAIN_HEALTH="yes"; shift ;;
|
||||
--render) RENDER_KIND="${2:-}"; [ $# -ge 2 ] && shift 2 || shift ;;
|
||||
--render) RENDER_SET="yes"; RENDER_KIND="${2:-}"; [ $# -ge 2 ] && shift 2 || shift ;;
|
||||
-h|--help)
|
||||
echo 'Usage: gstack-skill-start --skill NAME [--model OVERLAY] [--parent-pid PID] [--brain-health] [--render unattended]'
|
||||
echo 'Starts a skill session and prints its STATUS lines. --help starts nothing.'
|
||||
@@ -57,8 +58,8 @@ while [ $# -gt 0 ]; do
|
||||
esac
|
||||
done
|
||||
[ -n "$SKILL_NAME" ] || SKILL_NAME="unknown"
|
||||
case "$RENDER_KIND" in
|
||||
none|unattended) ;;
|
||||
case "$RENDER_SET:$RENDER_KIND" in
|
||||
no:|yes:unattended) ;;
|
||||
*) echo "gstack-skill-start: --render takes unattended (got '$(printf '%s' "$RENDER_KIND" | tr -cd 'a-zA-Z0-9._-')')" >&2; exit 2 ;;
|
||||
esac
|
||||
|
||||
|
||||
@@ -182,6 +182,7 @@ describe('gstack-skill-start --render unattended', () => {
|
||||
const bad = start(['--render', 'interactive']);
|
||||
expect(bad.status).toBe(2);
|
||||
expect(bad.stderr).toContain("--render takes unattended (got 'interactive')");
|
||||
expect(start(['--render', 'none']).status).toBe(2);
|
||||
const bare = start(['--render']);
|
||||
expect(bare.status).toBe(2);
|
||||
expect(bare.stderr).toContain("--render takes unattended (got '')");
|
||||
|
||||
Reference in new issue
Block a user