@Lou_Bertha to the best of my knowledge of the unzip command, the way youâre going about it, specifying paths with -o and -d, is probably the most straight-forward way to do it without having to make any other changes.
With that said, if you want to avoid the subdirectory / pathing behavior that youâre describing, youâll need to zip it at a different relative path⌠Which is a little weird to do with an exec node rather than a traditional command line, but this series of commands are working well for me:
cp -R ~/.node-red/node_modules ~/unsecured && cd ~/unsecured/node_modules && zip -r ~/unsecured/node_modules.zip * && rm -rf ~/unsecured/node_modules
This should combine well with the -d unzip feature to specify a path â just make sure you specify a node_modules destination folder since you donât want all that content flooding your unsecured file area!
unzip ~/unsecured/node_modules.zip -d /home/dev/unsecured/
node_modules
Hereâs all that wrapped up in a flow if youâd like to try it out:
[{"id":"caf0d5c4.f06778","type":"exec","z":"e02f10b4.235de","command":"cp -R ~/.node-red/node_modules ~/unsecured && cd ~/unsecured/node_modules && zip -r ~/unsecured/node_modules.zip * && rm -rf ~/unsecured/node_modules","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"backup node_modules","x":700,"y":1880,"wires":[["3df284ec.cc79cc"],[],[]]},{"id":"810742d9.2c803","type":"inject","z":"e02f10b4.235de","name":"BACKUP","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":500,"y":1880,"wires":[["caf0d5c4.f06778"]]},{"id":"3df284ec.cc79cc","type":"debug","z":"e02f10b4.235de","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":890,"y":1880,"wires":[]},{"id":"e3a05ac3.15ac48","type":"exec","z":"e02f10b4.235de","command":"unzip ~/unsecured/node_modules.zip -d /home/dev/unsecured/node_modules && rm ~/unsecured/node_modules.zip","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"restore node_modules","x":700,"y":1960,"wires":[["5ccfcc65.97a834"],[],[]]},{"id":"5ccfcc65.97a834","type":"debug","z":"e02f10b4.235de","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":890,"y":1960,"wires":[]},{"id":"aa2eb6c.8fa1e48","type":"inject","z":"e02f10b4.235de","name":"RESTORE","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":500,"y":1960,"wires":[["e3a05ac3.15ac48"]]}]