Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ try {
Invoke-WebRequest -Uri $url -OutFile $zipPath -UseBasicParsing
Expand-Archive -Path $zipPath -DestinationPath $tmp -Force

# Install to %USERPROFILE%\bin — no admin required
$installDir = Join-Path $env:USERPROFILE "bin"
# Install to %LOCALAPPDATA%\Programs\conjure — no admin required
$installDir = Join-Path $env:LOCALAPPDATA "Programs\conjure"
New-Item -ItemType Directory -Force -Path $installDir | Out-Null
Move-Item -Force (Join-Path $tmp "conjure.exe") (Join-Path $installDir "conjure.exe")

Expand Down
29 changes: 20 additions & 9 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,26 @@ trap 'rm -rf "$TMP"' EXIT
curl -sfL "$URL" | tar xzf - -C "$TMP" conjure
chmod +x "$TMP/conjure"

# Install to /usr/local/bin — use sudo if the directory is not writable
INSTALL_DIR="/usr/local/bin"
if [ -w "$INSTALL_DIR" ]; then
mv "$TMP/conjure" "$INSTALL_DIR/conjure"
else
echo "Installing to $INSTALL_DIR requires elevated permissions..."
sudo mv "$TMP/conjure" "$INSTALL_DIR/conjure"
fi
# Install to ~/.local/bin — no sudo required
INSTALL_DIR="${HOME}/.local/bin"
mkdir -p "$INSTALL_DIR"
mv "$TMP/conjure" "$INSTALL_DIR/conjure"

echo ""
echo "conjure ${VERSION} installed to ${INSTALL_DIR}/conjure"
echo "Run: conjure --version"

# Warn if the install directory is not on PATH
case ":${PATH}:" in
*":${INSTALL_DIR}:"*)
echo "Run: conjure --version"
;;
*)
echo ""
echo "NOTE: ${INSTALL_DIR} is not on your PATH."
echo "Add this line to your ~/.bashrc or ~/.zshrc, then restart your terminal:"
echo ""
echo ' export PATH="$HOME/.local/bin:$PATH"'
echo ""
echo "Then run: conjure --version"
;;
esac
Loading