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
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Not released yet

### Fixes

* Fix installer to better handle invalid --install-dir option

## 1.3.0 (2026-03-06)

### Features
Expand All @@ -21,7 +25,7 @@
* Add a `terminal()` function to get terminal properties
* Add a `#[AsArgsAfterOptionEnd]` attribute to get all arguments after `--` delimiter

### Fixed
### Fixes

* Do not generate stub if no castor file, also check for completion command name

Expand Down
14 changes: 14 additions & 0 deletions installer/bash-installer
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,22 @@ if [ $http_code != 200 ]; then
exit 1
fi

if [ ! -d "${binary_dest}" ]; then
# Backward-compatible quick fix: if --install-dir points to the castor binary path,
# install into its parent directory.
# There was a bug fixed in https://github.com/jolicode/castor/pull/786
if [ "$(basename "${binary_dest}")" = "${CASTOR_EXECUTABLE}" ]; then
binary_dest="$(dirname "${binary_dest}")"
fi
fi

if [ ! -d "${binary_dest}" ]; then
if ! mkdir -p "${binary_dest}"; then
if [ "${custom_dir}" = "true" ]; then
output "[castor-installer] Error: invalid value for --install-dir: '${binary_dest}'. Expected a directory, or a full path ending with '/${CASTOR_EXECUTABLE}'." "error"
exit 1
fi

binary_dest="."
fi
fi
Expand Down
Loading