I’m trying to use curl to upload a the contents of a directory to nexus via bash and am having a few issues in the command I’m using
In short I want to do a find command on a specific directory and use the –exec {} action to do a curl to nexus
However my find command returns the file path including the source directory and I want to change this so I only show the contents not the full path
e.g. say I have a directory called trunk which contains these files and sub directories
trunk/directory1/file1
trunk/directory2/file1
trunk/directory2/file2
I want my find command to return
directory1/file1
directory2/file1
directory2/file2
then this can be passed to my exec command
my current find command is:-
find trunk -type f -exec curl --user user:pass --ftp-create-dirs -T {} https://PATH_TO_NEXUS/{} \;
this works ok except the files being created in nexus are
https://PATH_TO_NEXUS/trunk/directory1/file1
and what I want is
https://PATH_TO_NEXUS/directory1/file1
anyone got any ideas?