2023-09-04 19:24:56 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
if [ -n "$XDG_CONFIG_HOME" ]; then
|
|
|
|
CONFIG_DIR="$XDG_CONFIG_HOME"
|
|
|
|
else
|
|
|
|
CONFIG_DIR="$HOME/.config"
|
|
|
|
fi
|
|
|
|
|
|
|
|
COPILOT_DIR="$CONFIG_DIR/github-copilot"
|
|
|
|
if [ ! -d "$COPILOT_DIR" ]; then
|
2023-09-05 13:12:10 +08:00
|
|
|
mkdir -p "$COPILOT_DIR"
|
2023-09-04 19:24:56 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo '{"github.com":{"user":"cocopilot","oauth_token":"ghu_ThisIsARealFreeCopilotKeyByCoCopilot","dev_override":{"copilot_token_url":"https://api.cocopilot.org/copilot_internal/v2/token"}}}' > "$COPILOT_DIR/hosts.json"
|
|
|
|
|
2023-09-04 21:05:54 +08:00
|
|
|
echo 'done. please restart your ide.'
|