Fix mv -T
Remove -T option
Hello @podvarkov, thanks for your contribution, can you make tests pass?
I tried :)
So it looks like the -T was useful ;)
Can you tell me how to run your project and tests locally? I cant run it? cause of babel imports :(
Tests were broken, I fixed it. But I think removing -T is not a good thing, it is actually required.
Tests were broken, I fixed it. But I think removing
-Tis not a good thing, it is actually required.
There's no "=T" option in my mac for mv. Here's the usage syntax for mv in osx:
usage: mv [-f | -i | -n] [-v] source target
mv [-f | -i | -n] [-v] source ... directory
@neoziro Why is this so? Is it because there can be already existing "current" directory which would cause the "current_tmp" to move inside the "current"? If this is the case we can just delete the directory if it exists. Now, simply move the "current_tmp" to "current" using mv current_temp current.
if [ -d "current" ]; then rm -Rf current; fi && mv current_tmp current
I don't think there's any problem with this approach. Any thoughts regarding this?
Yes I think you are right, it could probably exist and move it inside. We have to add a command to prevent it. Could you add it @podvarkov?
I'm seeing the same issue with -T not being supported on the server side. I think the solution would be to replace mv -fT current_tmp current with rm current && mv -f current_tmp current. This way the link is properly renamed and the old link is removed.
I ran into a similar issue deploying to FreeBSD and came up with a hack to work around it https://github.com/shipitjs/shipit/issues/173#issuecomment-751694482 however I'm not sure this will work for deploying to MacOS.
I think it maybe worth investigating some other solution for the longer term. Perhaps a move to using ln to update the symlinks rather than using mv, since it seems that mv functionality varies across platforms. Something like ln -nfs newlocation existinglink https://superuser.com/a/938865