Skip to content

Commit 2607610

Browse files
committed
Make --upgrade safer by failing fast if transcrypt config cannot be read #189
1 parent 016b2e4 commit 2607610

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ system, you must also run the `--upgrade` command in each repository:
3434

3535
## [Unreleased]
3636

37+
### Fixed
38+
39+
- Make --upgrade safer by failing fast if transcrypt config cannot be read
40+
(#189)
41+
3742
## [2.3.0] - 2024-09-10
3843

3944
### Added

transcrypt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -920,6 +920,11 @@ uninstall_transcrypt() {
920920

921921
# uninstall and re-install transcrypt to upgrade scripts and update configuration
922922
upgrade_transcrypt() {
923+
# Fail with an error if we cannot read the existing config
924+
if [[ ! $INSTALLED_VERSION ]]; then
925+
die 1 'no existing transcrypt configuration found'
926+
fi
927+
923928
if [[ $interactive ]]; then
924929
printf 'You are about to upgrade the transcrypt scripts in your repository.\n'
925930
printf 'Your configuration settings will not be changed.\n\n'

0 commit comments

Comments
 (0)