dsheiko / nw-autoupdater

⛔️ [DEPRECATED] Library provides low-level API to control NW.js app auto-updates
MIT License
75 stars 36 forks source link

App not swap with script #28

Open Arti3DPlayer opened 6 years ago

Arti3DPlayer commented 6 years ago

I use latest version 1.1.4 and when I call function restartToSwap app closes, start again, but didn't swap. I simply added alerts in restartToSwap function to check arguments

 async function restartToSwap(extraArgs = []){
    const { updateDir, logPath } = this.options,
          swap = swapFactory( this.options ),
          args = swap.getArgs().concat( extraArgs );

    swap.extractScript( updateDir );
    alert(swap.getRunner())
    alert(args)
    alert(updateDir)
    alert(logPath)
    await launch( swap.getRunner(), args, updateDir, logPath );
    nw.App.quit();
  }

alert(swap.getRunner()) /var/folders/5f/2w5ss9tn6ksgwmxkl1lrqyyh0000gn/T/nw-autoupdater/swap.sh

alert(args)

--app-path=/Users/artemhruzd/Jscode/rf_configurator/build/RaceFlight/osx64,
--update-path=/var/folders/5f/2w5ss9tn6ksgwmxkl1lrqyyh0000gn/T/nw-autoupdater,--runner=RaceFlight.app,
--bak-path=/Users/artemhruzd/Jscode/rf_configurator/build/RaceFlight/osx64/RaceFlight.app.bak

alert(updateDir) /var/folders/5f/2w5ss9tn6ksgwmxkl1lrqyyh0000gn/T/nw-autoupdater alert(logPath) /Users/artemhruzd/Library/Application Support/RaceFlight/Default/nw-autoupdater.log

So paths looks right, but script only creats RaceFlight.app.bak folder and thats all. In logs i see only one line:

rsync -al --delete /Users/artemhruzd/Jscode/rf_configurator/build/RaceFlight/osx64/. /Users/artemhruzd/Jscode/rf_configurator/build/RaceFlight/osx64/RaceFlight.app.bak/