Skip to content

Commit

Permalink
Make --upgrade safer by failing fast if transcrypt config cannot be r…
Browse files Browse the repository at this point in the history
…ead #189
  • Loading branch information
jmurty committed Jan 4, 2025
1 parent 016b2e4 commit 2607610
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ system, you must also run the `--upgrade` command in each repository:

## [Unreleased]

### Fixed

- Make --upgrade safer by failing fast if transcrypt config cannot be read
(#189)

## [2.3.0] - 2024-09-10

### Added
Expand Down
5 changes: 5 additions & 0 deletions transcrypt
Original file line number Diff line number Diff line change
Expand Up @@ -920,6 +920,11 @@ uninstall_transcrypt() {

# uninstall and re-install transcrypt to upgrade scripts and update configuration
upgrade_transcrypt() {
# Fail with an error if we cannot read the existing config
if [[ ! $INSTALLED_VERSION ]]; then
die 1 'no existing transcrypt configuration found'
fi

if [[ $interactive ]]; then
printf 'You are about to upgrade the transcrypt scripts in your repository.\n'
printf 'Your configuration settings will not be changed.\n\n'
Expand Down

0 comments on commit 2607610

Please sign in to comment.