Skip to content

Commit 36a3233

Browse files
committed
go-migrate/cli: ensure non 0 exit code if -path is missing
1 parent 1db37a7 commit 36a3233

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

go-migrate/cli.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func Run(m Migration) error {
3131

3232
if f.Path == "" {
3333
flag.Usage()
34-
return nil
34+
return fmt.Errorf("missing or empty path; flag '-path <ipfs_path>' is required")
3535
}
3636

3737
if !m.Reversible() {

sharness/t0080-migration-3-to-4.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,10 @@ test_expect_success "get pin lists" '
223223
ipfs pin ls --type=indirect | sort > more_start_ind_pins
224224
'
225225

226+
test_expect_success "'ipfs-3-to-4 -revert' fails without -path" '
227+
test_must_fail ipfs-3-to-4 -revert
228+
'
229+
226230
test_expect_success "'ipfs-3-to-4 -revert' succeeds" '
227231
ipfs-3-to-4 -revert -path="$IPFS_PATH" >actual
228232
'

0 commit comments

Comments
 (0)