Skip to content
Open
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
21 changes: 21 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Examples:
devc rebuild # Clean rebuild
devc shell # Open interactive shell
devc self-install # Install devc to PATH
devc self-upgrade # Upgrade the devc script and libraries
devc update # Update to latest version
devc exec ls -la # Run command in container
devc upgrade # Upgrade Claude Code to latest
Expand Down Expand Up @@ -647,6 +648,23 @@ cmd_self_install() {
fi
}

cmd_self_upgrade() {
# Check if devc exists in the PATH
if hash devc &> /dev/null; then
install_path="$(dirname "$(realpath "$(which devc)")")"
pushd "$install_path"
if git pull; then
log_success "Upgraded 'devc' at $install_path"
else
log_error "Failed to update 'devc', see output above"
fi
popd
else
# Install instead
cmd_self_install
fi
}

cmd_update() {
log_info "Updating devc..."

Expand Down Expand Up @@ -879,6 +897,9 @@ main() {
self-install)
cmd_self_install
;;
self-upgrade)
cmd_self_upgrade
;;
update)
cmd_update
;;
Expand Down