mirror of
https://github.com/github/awesome-copilot.git
synced 2026-02-20 10:25:13 +00:00
27 lines
574 B
Bash
Executable File
27 lines
574 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Log session start event
|
|
|
|
set -euo pipefail
|
|
|
|
# Skip if logging disabled
|
|
if [[ "${SKIP_LOGGING:-}" == "true" ]]; then
|
|
exit 0
|
|
fi
|
|
|
|
# Read input from Copilot
|
|
INPUT=$(cat)
|
|
|
|
# Create logs directory if it doesn't exist
|
|
mkdir -p logs/copilot
|
|
|
|
# Extract timestamp and session info
|
|
TIMESTAMP=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
|
|
CWD=$(pwd)
|
|
|
|
# Log session start (use jq for proper JSON encoding)
|
|
jq -Rn --arg timestamp "$TIMESTAMP" --arg cwd "$CWD" '{"timestamp":$timestamp,"event":"sessionStart","cwd":$cwd}' >> logs/copilot/session.log
|
|
|
|
echo "📝 Session logged"
|
|
exit 0
|