@@ -17,44 +17,49 @@ case "$OS" in
1717 * ) echo " ERROR: unsupported arch $ARCH " >&2 ; exit 1 ;;
1818 esac
1919 ;;
20- Windows* |MINGW* |CYGWIN* )
21- echo " ERROR: Windows não é suportado. Use macOS ou Linux." >&2
22- exit 1
20+ Windows* |MINGW* |MSYS* |CYGWIN* )
21+ BINARY=" squeez-windows-x86_64.exe"
2322 ;;
2423 * ) echo " ERROR: unsupported OS $OS " >&2 ; exit 1 ;;
2524esac
2625
26+ # Local binary name: squeez.exe on Windows, squeez elsewhere
27+ case " $OS " in
28+ Windows* |MINGW* |MSYS* |CYGWIN* ) BIN_NAME=" squeez.exe" ;;
29+ * ) BIN_NAME=" squeez" ;;
30+ esac
31+
2732mkdir -p " $INSTALL_DIR /bin" " $INSTALL_DIR /hooks" " $INSTALL_DIR /sessions" " $INSTALL_DIR /memory"
28- chmod 700 " $INSTALL_DIR " " $INSTALL_DIR /sessions" " $INSTALL_DIR /memory"
33+ chmod 700 " $INSTALL_DIR " " $INSTALL_DIR /sessions" " $INSTALL_DIR /memory" 2> /dev/null || true
2934
3035echo " Downloading squeez binary for $OS /$ARCH ..."
31- curl -fsSL " $RELEASES /$BINARY " -o " $INSTALL_DIR /bin/squeez "
36+ curl -fsSL " $RELEASES /$BINARY " -o " $INSTALL_DIR /bin/$BIN_NAME "
3237
3338echo " Verifying checksum..."
3439curl -fsSL " $RELEASES /checksums.sha256" -o /tmp/squeez-checksums.sha256
3540expected=$( grep " $BINARY " /tmp/squeez-checksums.sha256 2> /dev/null | awk ' {print $1}' )
3641rm -f /tmp/squeez-checksums.sha256
3742if [ -z " $expected " ]; then
3843 echo " ERROR: could not find checksum for $BINARY in release" >&2
39- rm -f " $INSTALL_DIR /bin/squeez "
44+ rm -f " $INSTALL_DIR /bin/$BIN_NAME "
4045 exit 1
4146fi
4247
43- # Use sha256sum if available (Linux), otherwise fall back to shasum (macOS)
48+ # Use sha256sum if available (Linux/Windows Git Bash ), otherwise fall back to shasum (macOS)
4449if command -v sha256sum > /dev/null 2>&1 ; then
45- actual=$( sha256sum " $INSTALL_DIR /bin/squeez " | awk ' {print $1}' )
50+ actual=$( sha256sum " $INSTALL_DIR /bin/$BIN_NAME " | awk ' {print $1}' )
4651else
47- actual=$( shasum -a 256 " $INSTALL_DIR /bin/squeez " | awk ' {print $1}' )
52+ actual=$( shasum -a 256 " $INSTALL_DIR /bin/$BIN_NAME " | awk ' {print $1}' )
4853fi
4954
5055if [ " $expected " != " $actual " ]; then
5156 echo " ERROR: checksum mismatch — binary may be corrupted or tampered" >&2
52- rm -f " $INSTALL_DIR /bin/squeez "
57+ rm -f " $INSTALL_DIR /bin/$BIN_NAME "
5358 exit 1
5459fi
5560echo " Checksum verified."
5661
57- chmod +x " $INSTALL_DIR /bin/squeez "
62+ chmod +x " $INSTALL_DIR /bin/$BIN_NAME " 2> /dev/null || true
5863
5964echo " Installing hooks..."
6065curl -fsSL " $REPO_RAW /hooks/pretooluse.sh" -o " $INSTALL_DIR /hooks/pretooluse.sh"
@@ -132,8 +137,8 @@ mkdir -p "$COPILOT_SQUEEZ_DIR/bin" "$COPILOT_SQUEEZ_DIR/hooks" \
132137chmod 700 " $COPILOT_SQUEEZ_DIR " " $COPILOT_SQUEEZ_DIR /sessions" " $COPILOT_SQUEEZ_DIR /memory" 2> /dev/null || true
133138
134139# Symlink the same binary so SQUEEZ_DIR-aware calls work
135- ln -sf " $INSTALL_DIR /bin/squeez " " $COPILOT_SQUEEZ_DIR /bin/squeez " 2> /dev/null || \
136- cp " $INSTALL_DIR /bin/squeez " " $COPILOT_SQUEEZ_DIR /bin/squeez "
140+ ln -sf " $INSTALL_DIR /bin/$BIN_NAME " " $COPILOT_SQUEEZ_DIR /bin/$BIN_NAME " 2> /dev/null || \
141+ cp " $INSTALL_DIR /bin/$BIN_NAME " " $COPILOT_SQUEEZ_DIR /bin/$BIN_NAME "
137142
138143curl -fsSL " $REPO_RAW /hooks/copilot-pretooluse.sh" -o " $INSTALL_DIR /hooks/copilot-pretooluse.sh"
139144curl -fsSL " $REPO_RAW /hooks/copilot-session-start.sh" -o " $INSTALL_DIR /hooks/copilot-session-start.sh"
@@ -143,7 +148,7 @@ chmod +x "$INSTALL_DIR/hooks/copilot-pretooluse.sh" \
143148 " $INSTALL_DIR /hooks/copilot-posttooluse.sh"
144149
145150# Seed Copilot instructions (writes ~/.copilot/copilot-instructions.md)
146- " $INSTALL_DIR /bin/squeez " init --copilot 2> /dev/null || true
151+ " $INSTALL_DIR /bin/$BIN_NAME " init --copilot 2> /dev/null || true
147152
148153# Register hooks in ~/.copilot/settings.json (Copilot CLI hook format mirrors Claude Code)
149154if [ -d " $HOME /.copilot" ]; then
@@ -183,7 +188,7 @@ os.replace(tmp, path)
183188COPILOT_EOF
184189fi
185190
186- version=$( " $INSTALL_DIR /bin/squeez " --version 2> /dev/null || echo " squeez" )
191+ version=$( " $INSTALL_DIR /bin/$BIN_NAME " --version 2> /dev/null || echo " squeez" )
187192echo " ✅ $version installed."
188193echo " "
189194echo " Claude Code: Restart Claude Code to activate."
0 commit comments