mirror of
https://github.com/ipfs/kubo.git
synced 2026-03-01 06:17:56 +08:00
add --dereference-args parameter
License: MIT Signed-off-by: Dominic Della Valle <ddvpublic@gmail.com>
This commit is contained in:
parent
90926ca5c7
commit
5a02b98702
@ -100,6 +100,7 @@ You can now check what blocks have been created by:
|
||||
},
|
||||
Options: []cmdkit.Option{
|
||||
cmds.OptionRecursivePath, // a builtin option that allows recursive paths (-r, --recursive)
|
||||
cmds.OptionDerefArgs, // a builtin option that resolves passed in filesystem links (--dereference-args)
|
||||
cmdkit.BoolOption(quietOptionName, "q", "Write minimal output."),
|
||||
cmdkit.BoolOption(quieterOptionName, "Q", "Write only final hash."),
|
||||
cmdkit.BoolOption(silentOptionName, "Write no output."),
|
||||
|
||||
@ -347,6 +347,19 @@ test_add_cat_raw() {
|
||||
'
|
||||
}
|
||||
|
||||
test_add_cat_derefargs() {
|
||||
test_expect_success "create and hash zero length file" '
|
||||
touch zero-length-file &&
|
||||
ZEROHASH=$(ipfs add -q -n zero-length-file)
|
||||
'
|
||||
|
||||
test_expect_success "create symlink and add with dereferenced arguments" '
|
||||
ln -s zero-length-file symlink-to-zero &&
|
||||
HASH=$(ipfs add -q -n --dereference-args symlink-to-zero) &&
|
||||
test $HASH = $ZEROHASH
|
||||
'
|
||||
}
|
||||
|
||||
test_add_cat_expensive() {
|
||||
ADD_FLAGS="$1"
|
||||
HASH="$2"
|
||||
@ -720,6 +733,8 @@ test_expect_success "ipfs add --only-hash succeeds" '
|
||||
echo "unknown content for only-hash" | ipfs add --only-hash -q > oh_hash
|
||||
'
|
||||
|
||||
test_add_cat_derefargs
|
||||
|
||||
#TODO: this doesn't work when online hence separated out from test_add_cat_file
|
||||
test_expect_success "ipfs cat file fails" '
|
||||
test_must_fail ipfs cat $(cat oh_hash)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user