Skip to content

Commit db740da

Browse files
committed
refactor: refactor script for improved reliability and cleanup
- Remove unused APP variable from the script - Use ${config_files[*]} instead of ${config_files[@]} when reporting missing config files - Quote $GITHUB_PATH when appending $INSTALL_DIR for better reliability Signed-off-by: appleboy <[email protected]>
1 parent 6178b77 commit db740da

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

install.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
set -euo pipefail
44

5-
APP=CodeGPT
6-
75
RED='\033[0;31m'
86
GREEN='\033[0;32m'
97
YELLOW='\033[1;33m'
@@ -183,7 +181,7 @@ for file in $config_files; do
183181
done
184182

185183
if [[ -z $config_file ]]; then
186-
log_error "No config file found for $current_shell. Checked files: ${config_files[@]}" 1
184+
log_error "No config file found for $current_shell. Checked files: ${config_files[*]}" 1
187185
fi
188186

189187
if [[ ":$PATH:" != *":$INSTALL_DIR:"* ]]; then
@@ -214,6 +212,6 @@ print_message info "To use the command, please restart your terminal or run:"
214212
print_message info " source $config_file"
215213

216214
if [ -n "${GITHUB_ACTIONS-}" ] && [ "${GITHUB_ACTIONS}" == "true" ]; then
217-
echo "$INSTALL_DIR" >>$GITHUB_PATH
215+
echo "$INSTALL_DIR" >>"$GITHUB_PATH"
218216
print_message info "Added $INSTALL_DIR to \$GITHUB_PATH"
219217
fi

0 commit comments

Comments
 (0)