shipitjs / shipit

Universal automation and deployment tool ⛵️
https://www.smooth-code.com
MIT License
5.33k stars 196 forks source link

mv: illegal option -- T #173

Open pbgms opened 6 years ago

pbgms commented 6 years ago

An error is produced on FreeBSD. It seems that FreeBSD does not have -T option for mv command. This option was introduced with shipit-deploy 2.5.0

'deploy:publish' errored after 553 ms
Error: Command failed: ssh user@server "cd /usr/home/…/nodejs && if [[ -d current && ! (-L current) ]]; then echo \"ERR: could not make symlink\"; else ln -nfs releases/20171204175536 current_tmp && mv -fT current_tmp current; fi"
mv: illegal option -- T
usage: mv [-f | -i | -n] [-hv] source target
       mv [-f | -i | -n] [-v] source ... directory
nitin-jotwani commented 6 years ago

Any solution? I'm also receiving this.

pbgms commented 6 years ago

@nitin-jotwani No, I don't use shipit for that project. But maybe downgrading to pre 2.5.0 version could solve this.

gregberge commented 6 years ago

No solution at this moment, sorry. I would have time to release v4, but I have a lot of work these days...

gregberge commented 6 years ago

I close it, feel free to reopen it after v4.

joja-agency commented 6 years ago

"An error is produced on FreeBSD. It seems that FreeBSD does not have -T option for mv command. This option was introduced with shipit-deploy 2.5.0".

Same on version 4.

gvlekke commented 5 years ago

also with deploying to a mac I have the same issue

Firer commented 3 years ago

I also ran into the same issue deploying to FreeBSD. I have a workaround monkey patch in my shipitfile.js which seems to be working. The equivalent to -T on FreeBSD for this specific use case is -h.

  shipit.blTask('fix-freebsd-mv', () => {
    shipit.pool.connections.forEach(connection => {
      const { run } = connection;

      connection.run = (cmd, options) => {
        cmd = cmd.replaceAll('mv -fT', 'mv -fh');
        return run.call(connection, cmd, options);
      }
    });
  });

  shipit.on('deploy', () => {
    return shipit.start(['fix-freebsd-mv']);
  });