Skip to content

Commit

Permalink
feat: 安装时创建好配置文件
Browse files Browse the repository at this point in the history
  • Loading branch information
YOUNGmaxer committed Mar 17, 2024
1 parent 04d21b5 commit b1956de
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## 0.3.1

- 安装时创建好配置文件

## 0.3.0

- 优化 show 命令展示
Expand Down
10 changes: 10 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ TARGET_CMD="gu"
# Remote script location
SCRIPT_URL="https://raw.githubusercontent.com/YOUNGmaxer/git-user/main/git-user.sh"

# Configuration file location
CONFIG_FILE="$HOME/.git_user_profiles"

echo "Installing $TARGET_CMD"

# Download the script using curl
Expand All @@ -35,6 +38,13 @@ sudo mv "$TARGET_CMD" "$TARGET_DIR/$TARGET_CMD" || {
# Check if successfully installed
if [ -f "$TARGET_DIR/$TARGET_CMD" ]; then
echo "Installation successful. You can now use '$TARGET_CMD' command anywhere."

# Create the configuration file if it does not exist
if [ ! -f "$CONFIG_FILE" ]; then
touch "$CONFIG_FILE"
else
echo "Configuration file already exists at $CONFIG_FILE"
fi
else
echo "Installation failed."
fi

0 comments on commit b1956de

Please sign in to comment.