mirror of
https://github.com/pengzhile/cocopilot.git
synced 2025-04-20 11:30:26 +08:00
Merge af1b55aa83811fd9ee354cec4741fb23b83597e5 into 63a1aa5134b2489e777fa43ff027bf03d6f3fd38
This commit is contained in:
commit
ada9ee8a47
13
cocopilot.sh
13
cocopilot.sh
@ -9,6 +9,19 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
COPILOT_DIR="$CONFIG_DIR/github-copilot"
|
COPILOT_DIR="$CONFIG_DIR/github-copilot"
|
||||||
|
|
||||||
|
# Check if the target file already exists
|
||||||
|
TARGET_FILE="$COPILOT_DIR/hosts.json"
|
||||||
|
|
||||||
|
if [ -f "$TARGET_FILE" ]; then
|
||||||
|
read -p "The file $TARGET_FILE already exists. Do you want to overwrite it? [y/N] " -r
|
||||||
|
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
||||||
|
echo "Operation cancelled."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Create directory
|
||||||
if [ ! -d "$COPILOT_DIR" ]; then
|
if [ ! -d "$COPILOT_DIR" ]; then
|
||||||
mkdir -p "$COPILOT_DIR"
|
mkdir -p "$COPILOT_DIR"
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user