scp-action icon indicating copy to clipboard operation
scp-action copied to clipboard

How to copy ONLY CONTENT of folder not the folder itself

Open devnull69 opened this issue 7 months ago • 5 comments

I have used your action to copy my build folder to an existing SSH remote folder

source: "build/*" target: "/www/htdocs/sjdgfjsd/mydestinationfolder/"

but it always creates the build folder on the target. How can I prevent this?

So the final folder structure is like this: /www/htdocs/sjdgfjsd/mydestinationfolder/build/

but it should be like this /www/htdocs/sjdgfjsd/mydestinationfolder/

devnull69 avatar May 06 '25 15:05 devnull69

Do you have any temporary workaround yet ? I also facing this issue atm ><

brendansiow avatar May 11 '25 06:05 brendansiow

Actually I do

Even though it doesn't sound correct, there is an option strip_components: true which made it work

devnull69 avatar May 11 '25 07:05 devnull69

@devnull69

strip_components: 1 is more correct

vanodevium avatar May 14 '25 08:05 vanodevium

God, I wish this wasn't an issue. source: public/* shouldn't have the exact same outcome as source: public/ and its so easy to waste time on that

stabor705 avatar Oct 07 '25 16:10 stabor705

Fixed: Added flatten Option

This issue is now resolved! I've added a new flatten parameter that automatically removes parent folder structure.

Usage:

source: "build/*"
target: "/www/htdocs/"
flatten: true  # Add this line

PR Link : #216

Result: Files from build/ are copied directly to target without creating a build/ subdirectory.

Note: Internal folder structure is preserved (e.g., build/styles/ becomes target/styles/).

ayyadurai-k avatar Nov 09 '25 12:11 ayyadurai-k