Browse Source

Ensure we create a directory with filenames extracted from the URL

tags/v0.5.2^2
Bèr Kessels 1 year ago
parent
commit
2fe9206522
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      wget-to-ipfs.sh

+ 2
- 1
wget-to-ipfs.sh View File

@@ -379,6 +379,7 @@ fi

_check_binary "ipfs"

_file_name="$(basename "${arg_u}")"

_file_hash="$(ipfs add --nocopy --cid-version=1 --quieter ${arg_u})"
info "Added ${arg_u} as ${_file_hash}"
@@ -388,7 +389,7 @@ if [[ -n ${arg_p} ]]; then
fi

if [[ -n ${arg_r} ]]; then
_new_dir="$(ipfs object patch ${arg_r} add-link $arg_u $_file_hash)"
_new_dir="$(ipfs object patch ${arg_r} add-link $_file_name $_file_hash)"
info "Placed ${arg_u} in directory, new root is ${_new_dir}"
fi


Loading…
Cancel
Save