1
0
Fork 0
mirror of https://github.com/imjasonh/cnotes synced 2026-07-18 14:47:18 +00:00

Prevent cnotes installation from temporary directories

- Add check for os.TempDir() and /tmp/ prefix
- Resolve symlinks to handle macOS temp directory structure
- Guide users to use 'go install' for proper installation
This commit is contained in:
Jason Hall 2025-07-21 14:57:34 -04:00
parent 3cfe51703e
commit 47abf1a0ce
Failed to extract signature
2 changed files with 395 additions and 1 deletions

View file

@ -9,6 +9,60 @@
"command": "/Users/jason/go/bin/cnotes"
}
]
},
{
"matcher": ".*",
"hooks": [
{
"type": "command",
"command": "/tmp/cnotes"
}
]
},
{
"matcher": ".*",
"hooks": [
{
"type": "command",
"command": "/tmp/test-cnotes"
}
]
},
{
"matcher": ".*",
"hooks": [
{
"type": "command",
"command": "/tmp/test-cnotes2"
}
]
},
{
"matcher": ".*",
"hooks": [
{
"type": "command",
"command": "/tmp/test-cnotes3"
}
]
},
{
"matcher": ".*",
"hooks": [
{
"type": "command",
"command": "/tmp/test"
}
]
},
{
"matcher": ".*",
"hooks": [
{
"type": "command",
"command": "/tmp/test-fail"
}
]
}
],
"PostToolUse": [
@ -20,6 +74,60 @@
"command": "/Users/jason/go/bin/cnotes"
}
]
},
{
"matcher": ".*",
"hooks": [
{
"type": "command",
"command": "/tmp/cnotes"
}
]
},
{
"matcher": ".*",
"hooks": [
{
"type": "command",
"command": "/tmp/test-cnotes"
}
]
},
{
"matcher": ".*",
"hooks": [
{
"type": "command",
"command": "/tmp/test-cnotes2"
}
]
},
{
"matcher": ".*",
"hooks": [
{
"type": "command",
"command": "/tmp/test-cnotes3"
}
]
},
{
"matcher": ".*",
"hooks": [
{
"type": "command",
"command": "/tmp/test"
}
]
},
{
"matcher": ".*",
"hooks": [
{
"type": "command",
"command": "/tmp/test-fail"
}
]
}
],
"PreCompact": [
@ -31,6 +139,60 @@
"command": "/Users/jason/go/bin/cnotes"
}
]
},
{
"matcher": ".*",
"hooks": [
{
"type": "command",
"command": "/tmp/cnotes"
}
]
},
{
"matcher": ".*",
"hooks": [
{
"type": "command",
"command": "/tmp/test-cnotes"
}
]
},
{
"matcher": ".*",
"hooks": [
{
"type": "command",
"command": "/tmp/test-cnotes2"
}
]
},
{
"matcher": ".*",
"hooks": [
{
"type": "command",
"command": "/tmp/test-cnotes3"
}
]
},
{
"matcher": ".*",
"hooks": [
{
"type": "command",
"command": "/tmp/test"
}
]
},
{
"matcher": ".*",
"hooks": [
{
"type": "command",
"command": "/tmp/test-fail"
}
]
}
],
"PreToolUse": [
@ -42,6 +204,60 @@
"command": "/Users/jason/go/bin/cnotes"
}
]
},
{
"matcher": ".*",
"hooks": [
{
"type": "command",
"command": "/tmp/cnotes"
}
]
},
{
"matcher": ".*",
"hooks": [
{
"type": "command",
"command": "/tmp/test-cnotes"
}
]
},
{
"matcher": ".*",
"hooks": [
{
"type": "command",
"command": "/tmp/test-cnotes2"
}
]
},
{
"matcher": ".*",
"hooks": [
{
"type": "command",
"command": "/tmp/test-cnotes3"
}
]
},
{
"matcher": ".*",
"hooks": [
{
"type": "command",
"command": "/tmp/test"
}
]
},
{
"matcher": ".*",
"hooks": [
{
"type": "command",
"command": "/tmp/test-fail"
}
]
}
],
"Stop": [
@ -53,6 +269,60 @@
"command": "/Users/jason/go/bin/cnotes"
}
]
},
{
"matcher": ".*",
"hooks": [
{
"type": "command",
"command": "/tmp/cnotes"
}
]
},
{
"matcher": ".*",
"hooks": [
{
"type": "command",
"command": "/tmp/test-cnotes"
}
]
},
{
"matcher": ".*",
"hooks": [
{
"type": "command",
"command": "/tmp/test-cnotes2"
}
]
},
{
"matcher": ".*",
"hooks": [
{
"type": "command",
"command": "/tmp/test-cnotes3"
}
]
},
{
"matcher": ".*",
"hooks": [
{
"type": "command",
"command": "/tmp/test"
}
]
},
{
"matcher": ".*",
"hooks": [
{
"type": "command",
"command": "/tmp/test-fail"
}
]
}
],
"SubagentStop": [
@ -64,6 +334,60 @@
"command": "/Users/jason/go/bin/cnotes"
}
]
},
{
"matcher": ".*",
"hooks": [
{
"type": "command",
"command": "/tmp/cnotes"
}
]
},
{
"matcher": ".*",
"hooks": [
{
"type": "command",
"command": "/tmp/test-cnotes"
}
]
},
{
"matcher": ".*",
"hooks": [
{
"type": "command",
"command": "/tmp/test-cnotes2"
}
]
},
{
"matcher": ".*",
"hooks": [
{
"type": "command",
"command": "/tmp/test-cnotes3"
}
]
},
{
"matcher": ".*",
"hooks": [
{
"type": "command",
"command": "/tmp/test"
}
]
},
{
"matcher": ".*",
"hooks": [
{
"type": "command",
"command": "/tmp/test-fail"
}
]
}
],
"UserPromptSubmit": [
@ -75,7 +399,61 @@
"command": "/Users/jason/go/bin/cnotes"
}
]
},
{
"matcher": ".*",
"hooks": [
{
"type": "command",
"command": "/tmp/cnotes"
}
]
},
{
"matcher": ".*",
"hooks": [
{
"type": "command",
"command": "/tmp/test-cnotes"
}
]
},
{
"matcher": ".*",
"hooks": [
{
"type": "command",
"command": "/tmp/test-cnotes2"
}
]
},
{
"matcher": ".*",
"hooks": [
{
"type": "command",
"command": "/tmp/test-cnotes3"
}
]
},
{
"matcher": ".*",
"hooks": [
{
"type": "command",
"command": "/tmp/test"
}
]
},
{
"matcher": ".*",
"hooks": [
{
"type": "command",
"command": "/tmp/test-fail"
}
]
}
]
}
}
}