ai-global 1.11.0 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ai-global +11 -11
- package/package.json +1 -1
package/ai-global
CHANGED
|
@@ -15,7 +15,7 @@ COMMANDS_DIR="$CONFIG_DIR/commands"
|
|
|
15
15
|
PROMPTS_DIR="$CONFIG_DIR/prompts"
|
|
16
16
|
|
|
17
17
|
# Version
|
|
18
|
-
VERSION="1.
|
|
18
|
+
VERSION="1.13.0"
|
|
19
19
|
|
|
20
20
|
# Colors
|
|
21
21
|
RED='\033[0;31m'
|
|
@@ -400,9 +400,16 @@ collect_instructions() {
|
|
|
400
400
|
fi
|
|
401
401
|
done
|
|
402
402
|
|
|
403
|
+
# Skip if global.md already exists
|
|
404
|
+
if [[ -f "$GLOBAL_MD" ]]; then
|
|
405
|
+
log_ok "Preserved existing $GLOBAL_MD (skipped merge)"
|
|
406
|
+
return
|
|
407
|
+
fi
|
|
408
|
+
|
|
409
|
+
# Only create and merge if global.md doesn't exist
|
|
403
410
|
if [[ $found_count -gt 0 ]]; then
|
|
404
411
|
echo -e "$merged_content" > "$GLOBAL_MD"
|
|
405
|
-
log_ok "Merged instructions from $found_count tool(s)"
|
|
412
|
+
log_ok "Merged instructions from $found_count tool(s) to $GLOBAL_MD"
|
|
406
413
|
else
|
|
407
414
|
cat > "$GLOBAL_MD" << 'EOF'
|
|
408
415
|
# AI Assistant Instructions
|
|
@@ -908,7 +915,7 @@ upgrade() {
|
|
|
908
915
|
log_info "Checking for updates..."
|
|
909
916
|
|
|
910
917
|
local remote_version
|
|
911
|
-
remote_version=$(curl -fsSL "https://raw.githubusercontent.com/nanxiaobei/ai-global/main/
|
|
918
|
+
remote_version=$(curl -fsSL "https://raw.githubusercontent.com/nanxiaobei/ai-global/main/ai-global" 2>/dev/null | grep '^VERSION=' | head -1 | sed 's/VERSION="\([^"]*\)"/\1/')
|
|
912
919
|
|
|
913
920
|
if [[ -z "$remote_version" ]]; then
|
|
914
921
|
log_warn "Could not check for updates"
|
|
@@ -929,20 +936,13 @@ upgrade() {
|
|
|
929
936
|
fi
|
|
930
937
|
|
|
931
938
|
local exec_temp=$(mktemp)
|
|
932
|
-
|
|
933
|
-
if curl -fsSL "https://raw.githubusercontent.com/nanxiaobei/ai-global/main/ai-global" -o "$exec_temp" 2>/dev/null && \
|
|
934
|
-
curl -fsSL "https://raw.githubusercontent.com/nanxiaobei/ai-global/main/package.json" -o "$pkg_json_tmp" 2>/dev/null; then
|
|
939
|
+
if curl -fsSL "https://raw.githubusercontent.com/nanxiaobei/ai-global/main/ai-global" -o "$exec_temp" 2>/dev/null; then
|
|
935
940
|
chmod +x "$exec_temp"
|
|
936
941
|
mv "$exec_temp" "$current_script"
|
|
937
942
|
|
|
938
|
-
# Also update package.json in the same directory as the script
|
|
939
|
-
local script_dir=$(dirname "$current_script")
|
|
940
|
-
mv "$pkg_json_tmp" "$script_dir/package.json"
|
|
941
|
-
|
|
942
943
|
log_ok "Upgraded to v$remote_version"
|
|
943
944
|
else
|
|
944
945
|
rm -f "$exec_temp"
|
|
945
|
-
rm -f "$pkg_json_tmp"
|
|
946
946
|
log_error "Failed to download update"
|
|
947
947
|
return 1
|
|
948
948
|
fi
|