codexctl icon indicating copy to clipboard operation
codexctl copied to clipboard

Always redownloads firmware

Open Blockmaster2706 opened this issue 2 years ago • 3 comments

Just tried to use this using the latest windows release, and everytime I ran the install command, it told me that it could not find the firmware and downloaded it again, even though it already did.

image

Blockmaster2706 avatar Nov 15 '23 18:11 Blockmaster2706

It looks like the logic to check what updates are already downloaded hasn't been updated to handle the changes for #29

Eeems avatar Nov 15 '23 18:11 Eeems

Hi there, looking at this now

Jayy001 avatar Nov 21 '23 22:11 Jayy001

I'm looking at fixing this behaviour but have some questions around what the desired behaviour is. At the moment any files downloaded during the install command are removed after installation, which doesn't seem to always be what's desired.

It does make sense to me to perform cleanup on the remarkable for saving space, are there any other reasons? When remote we could store the files in the system's temporary directory and allow it to clean up the files when it wants to.

If we are to stick with the install command removing updates after installation then should we have the download command play nicer with the install one? For my use-case, I'd want it to work so that for any version x I can run codexctl download x then codexctl install x and that would simply work.

I also think that if an out directory is specified for the download command and that same directory is specified to serve from for the install command then these should also work together. At the moment it doesn't work this way.

My proposed flow for download and install would be as follows, I can start work on a PR to get it working this way if it seems desirable:

---
title: Download Flow
---
graph TD
    toOut[download to out folder]
    toDownDir[download to user Downloads/rm_updates]
    download -- out dir specified --> toOut
    download -- no out dir specified --> toDownDir
---
title: Install Flow
---
graph TD
	install[install]
    useServe[use serve dir]
    useSysTemp[use system temp dir]
    useTemp["use temp dir (cleanup after)"]
    useDl[use Downloads/rm_updates update]
    scanDl[scan Downloads/rm_updates for desired version]
    checkPlatform[are we remote?]
    install -- serve dir specified --> useServe
    install -- no serve folder specified --> scanDl -- doesn't exist 
    --> checkPlatform -- remarkable --> useTemp
    checkPlatform -- remote --> useSysTemp
    scanDl -- exists --> useDl

I'd appreciate any thoughts on this.

alan-roe avatar Feb 26 '24 14:02 alan-roe